Conversation
|
I'm still a little unsure of the |
|
I also added a dependency: System.Numerics.Vectors. My understanding is that it's included in .NET Standard 2.1 and up, but for earlier versions you have to add the NuGet package. I know you dislike adding dependencies, so I'm happy to write a simple |
fix whitespace so ScottPlot#1863 doesn't show more modified csproj lines than necessary
also refactors normal vector calculation and fixes a bug where the invert bool selected the wrong vector
|
Hey @bclehmann, this looks great! Here are my thoughts, and depending on your responses I can merge now or wait for an update then merge when you say it's ready. DependenciesRegarding the Naming is Hard
When rendering you could assume the line is always diagonal from lower-left to upper-right (using Just an idea! I'm okay with it how it is if nothing better comes to mind. |
Yeah, I had a few ideas, but I don't know which (if any) are actually intuitive from an API perspective:
I think the best option is to specify an angle (relative to the plotting frame, not an angle relative to Of course, the most mathematically beautiful option is for them to specify |
|
Hey sorry for being brief but I'm on mobile and can respond in more detail tomorrow if needed, but I'm definitely leaning toward the first one. Does this problem get easier if the user gives two points (maybe even two |
|
I implemented it, the only question is if the name |
Thanks! I like the new name. Again, I really appreciate this PR - it's looking great! 🚀 Looking at this today I think I'll make 2 more quick improvements then merge in a few minutes.
|
|
Oof, this doesn't look as clean as I was hoping.... plt.AddBracket(new Coordinate(33, -1), new Coordinate(43, -1), "A");vs. plt.AddBracket(33, -1, 43, -1, "A");I'll leave the overload but probably revert to passing integers for the cookbook. I wish there were a more elegant way to pass pairs of numbers as arguments |
Ah, that was a mistake, it used to be (0, 0) and (1, 1), I changed it to be random because it was useful for testing. As for the new overload, I like it, if you use the abbreviated syntax it can be quite clean: plt.AddBracket(new(1, 1), new(2, 2));Or alternatively: plt.AddBracket(new() { X = 1, Y = 1 }, new() { X = 2, Y = 2 }); |
|
@bclehmann I'm merging this now, but I noticed some surprising behavior at the corners as the axes stretch away from a square aspect ratio and opened an issue #1869 - I didn't try to fix it yet (I'll put this down for tonight), but you can have a go at it if you're up for the challenge! Seems like more vector math "fun" redoing all the calculations to respect aspect ratio 😅 |
I forgot about this syntax - I love it! I'd love to move toward using |
Purpose:
#1302 #1028