Given the lat long of the centre of a rectangle, how do you get the lat long of the bottom left corner of the rectangle - geospatial

I have the latitude and longitude of a point. This point is in the centre of a rectangle that is 2miles wide and 8 miles long. The rectangle has an azimuth (angle from north) of 35degs. How do I get the latitude and longitude of the bottom left corner of the rectangle.

Related

How can I calculate the distance between a latitude and longitude coordinate and an array of latitude and longitudes

I have a co-ordinate point (-62.68S,31.08E) and an array of latitudes and longitudes.
How would i calculate the distance between the coordinate and every lat/lon point in the array?
The array of latitudes and the array of longitudes are both the of size 35900 so I should get an array of distances of size 35900.
THANKS!

Converte circle coordinates in to degree values in gnuplot

I have a data file with 3 columns: The first 2 are coordinates of a circle, the 3. are results . How can I convert this x-y-coordinates into a range of degree (range of the x-axis: 0 - 360). I want to show results in a XY-plot. I don't want to create a further column in my data file, I want to convert the values directly with gnuplot. Is this possible?
Just remember your high school geometry and how to convert Cartesian coordinates to polar coordinates. Suppose you have a Cartesian coordinate (x, y). Draw a line between this point and the origin. The angle θ between this line and the x-axis is related by tan θ = y/x and the distance r from the origin is sqrt(x2 + y2).
So your angle θ is just the arc tangent (inverse tangent) of y/x. In gnuplot, this is the atan() function. I'd write something like this:
set angles degrees
plot 'infile.dat' using (atan($2/$1)):3 with points
where column 3 is your "result" (the roughness) and columns 1 and 2 are your Cartesian coordinates. It uses the calculated θ value for the horizontal plotted axis and the roughness for the vertical plotted axis.
The set angles command lets you set the unit used by atan() to degrees or radians. Since you specified a range of 0-360, it is set angles degrees.
It will plot the points in the order as they appear in the file. Notice that depending on the order of points in your data file, the order of the points after this calculation may no longer be visually sequential, so this example uses with points.

Calculate angle to translate the circle at the 90 degree on an arc

I have one design like this:
Now i want to calculate angle between the clicked circle and the position at 90 degrees on outer arc. How do i calculate that ?
I have angle of outer circles in radians.

How to find the centroid of multiple rectangles?

I have to find the exact centroid of multiple rectangles (Minimum Bounded Rectangle).
Let I have, 3 rectangles and their co-ordinates for the maximum and minimum points
1st rectangle's minimum point (x1,y1) , maximum point (x2,y2)
2nd rectangle's minimum point (x3,y3) , maximum point (x4,y4)
3rd rectangle's minimum point (x5,y5) , maximum point (x6,y6)
I quick solution come over my mind is , I will find possible list of centroids by considering combinations of this 6 points and then take the minimum bounded rectangle of those centroids. It will give me a rectangle R , the centroid of that rectangle is my real centroid.
For example , a combination is (x1,y1)+(x3,y3)+(x5,y5) ,
another combination is (x1,y1)+(x3,y3)+(x6,y6) etc
But i am confused will it give me the real centroid ? Is there any other way to find the centroid ?
I share Spektre's confusion on the problem statement. But if you just want the centroid of the point-set defined by the rectangles, here's how to do it:
If Ai is the area of rectangle i, and Ci is the centroid of rectangle i, then the centroid of all the rectangles taken together is just:
Sum(i = 1..n; Ai Ci)/Sum(i = 1..n; Ai)
The area and centroid of each rectangle is easy to compute from basic geometry.
You can think of each rectangle as having all it's mass (same as the area if we assume unit density). Then we just need the mass-weighted average of those points.

Forming right triangle with given hypotenuse and angles

I have two points A=[ax,ay] and B=[bx,by] and i have angle in right triangle for CAB, for CBA (thats 90-ACB) and for ACB (90, right angle). Now i want to get coordinates [cx,cy] of point C (from two possibilities, i want that one C point which lies to left of orientated line segment form A to B).
How should I do it?
Calculate middle point D=(A+B)/2
Rotate vector DB on angle 2*CAB
(this is based on facts that centre of circumscribed circle is the middle of hypotenuse and that angle from centre is twice angle from A)
let's B-D=(dx,dy)
then C=D+(dx*cos2a+dy*sin2a,dy*cos2a-dx*sin2a)
Since you're given a side and two adjanced angles, what's left is to construct the the lines for the other two sides and intersect them.
Rotate the vector A->B by the angle BAC to the left, rotate the vector B->A by the angle ABC to the right and intersect.
To rotate a vector to the left, multiply it by the rotation matrix:
cos(a) sin(a)
-sin(a) cos(a)
To intersect two lines in their parametric forms in 2D, solve both parameters simultaneously, comparing the two components for both lines.

Resources