You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may be misunderstanding what you're looking for, so I want to confirm...
It sounds like you're converting the current mouse position and a corner on the rectangle to a vector. To find the distance between those two points using the vector, you can get the vector's length. Would that work for you?
@amcdnl I think you're using vectors instead of point. Use points to map mouse pointer positions. Maybe I'm wrong but I think of vector as what you need to move p1 to p2. For example P1(0,0), if i apply v(1,2) to p1 it results in p2(1,2), then if I apply v2(1,1) to p2 it results in p3(2,3) so there isn't a distance between 2 vector because it's a third v3(2,3). This is because if apply v3 to p1 I'll get p3.
The
Point2D
has adistanceFrom
function - it would be useful if theVector2D
has a similar function.Example: I have a SVG
rect
and a mouse event and I want to know the distance from any point in therect
.The text was updated successfully, but these errors were encountered: