Vans S
Vans S

Reputation: 1813

find area of 2 coordinates

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

Answers (1)

SLaks
SLaks

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

Related Questions