how to calculate diagonally center points of rectangle, triangle, circle and polygons. anyone help me.
In the attachment image I need x1,y1 and x2,y2 points like this for some other shapes.
how to calculate diagonally center points of rectangle, triangle, circle and polygons. anyone help me.
In the attachment image I need x1,y1 and x2,y2 points like this for some other shapes.
Hi,
I'm not quite sure that I understand your question properly because triangles and circles don't have any diagonals ...
If you have a rectangle and the center C of this rectangle is $\displaystyle C\left(x_C, y_C\right)$ then
$\displaystyle x_C = \frac{x_1+x_2}{2}~\text{and}~y_C = \frac{y_1+y_2}{2} $
Your question can't be answered in general.
But if the following conditions are satisfied you can find some relations between the variables in question.
1. Conditions:
a) The sides of the rectangle are parallel to the coordinate axes.
b) The measures of the rectangle are (known) constant values: w, l.
2. Relations:
a) $\displaystyle x_2 - x_1 = w$
If you want to get more relations then you must know the coordinates of the vertices of the rectangle.