Reputation: 1813
How can I find the area of the rectangle formed with 2 2-dimensional Vectors. ex: p1 = (20, 40); p2 = (30, 60);
I need to find the rectangle this forms. Is there a common used formula?
Upvotes: 0
Views: 116
Reputation: 887449
Just multiply the lengths of the sides of the rectangle, which are the differences between the coordinates of the two vectors:
(p2.X - p1.X) * (p2.Y - p1.Y)
Upvotes: 5