In my application user points two points PointA
and PointB
on the same row (could be at any angle). So I have the following information
PointA coordinates
pointB coordinates
Distance between PointA and Point B
An Across distance (taken from user as input to draw other points)
Angle (calculated from pointA and pointB).
Based on this information, another application draws four points (vertices of rectangle).
What I have to do is, I have to find the centre point of those four points (rectangle) to be able to properly draw the rectangle bounded between those 4 points.
Right now I am able to draw the rectangle taking the centre as the pointA which obviously is incorrect. What formula should I use to calculate the centre of Rectangle so that I can draw a bounded rectangle?
Image 1:
Image 2:
Image 3:
Image 4:
Image 5:
As seen in the attached images, in every case rectangle is getting drawn with pointA as centroid. While I want the centroid to the centre of the FOUR points.
P.S: All angles are measured 0 degrees North.