I am not good with math,and i just need someone to point me in the right direction.
Latitude Longitude
N 36° 13.488' W 095° 54.295'
N 36° 13.488' W 095° 53.805'
Assume that all three are located on a flat plane, at the same elevation.
Assume that the curvature of the earth is not a factor.
Assume that there are exactly 69.1691 miles per degree of latitude.
Assume that there are 55.9588 miles per degree of longitude (Tulsa area only)..
I am trying to figure out what the last points coordinate is.
Can anyone help. I just dont know where to begin
There are numerous ways to find the third point. The angles in an equilateral triangle are all 60 degrees. The third point lies on the bisector of the line connecting the two points you have. Expressing the points and lines using vectors, rather than coordinates, helps.
But the truth is, if you do not have enough mathematical knowledge for this kind of problem, you probably ought not to be tackling it as a programming problem. How can you know you've done it right?
Related
I am currently working on a hole detection problem in 3D point cloud data. I am referring to this paper "Detecting Holes in Point Set Surfaces" by Gerhard H Bendels, Ruwen Schnabel and Reinhard Klein. One of the criterions mentioned is an Angle Criterion in which we need to determine angles between consecutive points in a KD Tree(Radially Nearest Neighbors to a given point).
See Image:
Angle between points
I am using Open3D to extract a KD Tree but I believe it is giving me an unsorted list of points rather than a list of consecutive points.
See Image:
List of Nearest neighbors
The point below '______' is the point of interest and rest are it's neighbors. Now my question is,
How do I know which point is next to which point?
And if that's not possible to know, How can I find the angles as shown in the first image.
I just need the angles to find the boundary probability for each point, so an answer would really help me progress.
Thanks
What I've Tried so far..
I have tried generating vectors out of all the points and calculated the angles using dot product. But that seems wrong because I believe I may be calculating dot products between first and third point.
I start this thread asking for your help in Excel.
The main goal is to determine the coordinates of the intersection point P=(x,y) between two curves (curve A, curve B) modeled by points.
The curves are non-linear and each defining point is determined using complex equations (equations are dependent by a lot of parameters chosen by user, as well as user will choose the number of points which will define the accuracy of the curves). That is to say that each curve (curve A and curve B) is always changing in the plane XY (Z coordinate is always zero, we are working on the XY plane) according to the input parameters and the number of the defining points is also depending by the user choice.
My first attempt was to determine the intersection point through the trend equations of each curve (I used the LINEST function to determine the coefficients of the polynomial equation) and by solving the solution putting them into a system. The problem is that Excel is not interpolating very well the curves because they are too wide, then the intersection point (the solution of the system) is very far from the real solution.
Then, what I want to do is to shorten the ranges of points to be able to find two defining trend equations for the curves, cutting away the portion of curves where cannot exist the intersection.
Today, in order to find the solution, I plot the curves on Siemens NX cad using multi-segment splines with order 3 and then I can easily find the coordinates of the intersection point. Please notice that I am using the multi-segment splines to be more precise with the approximation of the functions curve A and curve B.
Since I want to avoid the CAD tool and stay always on Excel, is there a way to select a shorter range of the defining points close to the intersection point in order to better approximate curve A and curve B with trend equations (Linest function with 4 points and 3rd order spline) and then find the solution?
I attach a picture to give you an example of Curve A and Curve B on the plane:
https://postimg.cc/MfnKYqtk
At the following link you can find the Excel file with the coordinate points and the curve plot:
https://www.mediafire.com/file/jqph8jrnin0i7g1/intersection.xlsx/file
I hope to solve this problem with your help, thank you in advance!
kalo86
Your question gave me some days of thinking and research.
With the help of https://pomax.github.io/bezierinfo/
§ 27 - Intersections (Line-line intersections)
and
§ 28 - Curve/curve intersection
your problem can be solved in Excel.
About the mystery of Excel smoothed lines you find details here:
https://blog.splitwise.com/2012/01/31/mystery-solved-the-secret-of-excel-curved-line-interpolation/
The author of this fit is Dr. Brian T. Murphy, PhD, PE from www.xlrotor.com. You find details here:
https://www.xlrotor.com/index.php/our-company/about-dr-murphy
https://www.xlrotor.com/index.php/knowledge-center/files
=>see Smooth_curve_bezier_example_file.xls
https://www.xlrotor.com/smooth_curve_bezier_example_file.zip
These knitted together you get the following results for the intersection of your given curves:
for the straight line intersection:
(x = -1,02914127711195 / y = 23,2340949174492)
for the smooth line intersection:
(x = -1,02947493047196 / y = 23,2370611219553)
For a full automation of your task you would need to add more details regarding the needed accuracy and what details you need for further processing (and this is actually not the scope of this website ;-).
Intersection of the straight lines:
Intersection of the smoothed lines:
comparison charts:
solution,
Thank you very much for the anwer, you perfectly centered my goal.
Your solution (for the smoothed lines) is very very close to what I determine in Siemens NX.
I'm going to read the documentation at the provided link https://pomax.github.io/bezierinfo/ in order to better understand the math behind this argument.
Then, to resume my request, you have been able to find the coordinates (x,y) of the intersection point between two curves without passing through an advanced CAD system with a very good precision.
I am starting to study now, best regards!
kalo86
I need to find points (from a rather small dataset) which are close enough to a polyline. All coordinates are WGS84.
I think of some r-tree thing to reduce the data to just a few candidates which then have to be checked in more detail.
While i managed to do this using "great circle" arithmetic, i am sure this is too pedantic for the following reasons:
The segmentation of those polylines is quite high. A single segment of a polyline can be considered to be no longer than 10 km.
The points in question are not more than a few hundred meters away from segments.
The area in question is Europe, so the algorithm does not need to be valid for extreme (near pole?) conditions. Again: points don't need to be checked agains the whole polyline (which could be hundrets of kilometers). Only the "nearby" segments need to be considured.
Do i need to transform the WGS84 coordinates to
some local cartesian reference system
to a mercator system
Or can i even just calculate with "angle differences"? I know that this is just a matter of accuracy: I can accept an error which is below ~50 meters.
I highly appreciate your suggestions!
On how to measure distance from point to polyline:
you have to measure distances from all your points to all segments of a polyline.
See Distance from a point to a polygon
You can do without converting coordinates to cartesian (especially if the area is rather small, you don't mind 50 meters error and you don't need exact distances, just relative) See https://en.wikipedia.org/wiki/Decimal_degrees.
I have a group of points (x,y) and I need to find out the distance between the two that are farthest apart.
What is the most efficient way to find this?
Thanks
Well, compairing every point against every other point is certainly not efficient.
The most efficient way involves finding the convex hull, which is the convex polygon (no angles > 180) surrounding all points.
After that, you find the farthest points on the hull, using antipodal pairs.
Algorithm described here:
http://www.seas.gwu.edu/~simhaweb/cs153/lectures/module1/module1.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I have a Latitude, Longitude, and a direction of travel in degrees true north. I would like to calculate if I will intersect a line defined by two more Lat/Lon points.
I figure the two points defining the line would create my great circle and my location and azimuth would define my Rhumb line.
I am only interested in intersections that will occur with a few hundred kilometers so I do not need every possible solution.
I have no idea where to begin.
The simple answer is yes -- if you start from any lat/lon and continue traveling along some great circle, you will eventually cross any and all other great circles on the earth. Every two great circles on earth cross each other in exactly two points (with the notable exception of two identical great circles, which, well, cross each other in all their points.)
But I guess you are not merely asking a yes/no question. You may be wondering where, exactly, those two great circles intersect. We can use the following strategy to find that out:
Each great circle lies on a plane that goes through the center of the earth.
The intersection of those planes is a line (assuming they are not both the exact same plane.)
That intersecting line crosses the surface of the earth at two points -- exactly where our two great circles intersect.
Our mission is thus: (1) find the planes. (2) find their intersection line. (3) find the two intersection points, and finally, (4) express those intersection points in terms of lat/long. (5) extra credit for figuring out which intersecting point is closer to the lat/lon you started at.
Sounds good? The following does this with trig and vector math. To simplify the math somewhat, we'll:
work with the unit sphere, the one centered at the origin of our (x,y,z) coordinate system, and has a radius of 1: x^2+y^2+z^2=1.
we'll assume the earth is a perfect sphere. Not a geoid. Not even a flattened sphere.
we'll ignore elevation.
Step 1 -- find the planes:
All we really care about is the plane normals. Here's how we go and find them:
--One great circle is defined by two points on the earth that it crosses
The normal will be the cross product of the (x,y,z) vectors of each point from the origin (0,0,0). Given the lat/lon of each point, using spherical coordinates conversion, the corresponding (x,y,z) are:
x=cos(lat)*sin(lon)
y=cos(lat)*cos(lon)
z=sin(lat)
With that, and our two points given as lat1/lon1 and lat2/lon2, we can find out the vectors P1=(x1,y1,z1) and P2=(x2,y2,z2).
The first great circle normal is then the cross product:
N1=P1 x P2
--The other great circle is defined by a point on the earth and an azimuth
We have a point P3 and an azimuth T. We'll find a point P4 along the great circle going through P3 at azimuth T at a distance of PI/4 by using the spherical law of cosines (also solved for our convenience here):
lat4=asin(cos(lat3)*cos(T))
lon4=lon3+atan2(sin(T)*cos(lat3),-sin(lat3)*sin(lat4))
Then the normal is as before:
N2=P3 x P4
Step 2: find the planes intersecting line:
Given the two plane normals, their cross product defines their intersecting line:
L=N1 x N2
Step 3: find the intersection points:
Just normalize the vector L to get one of the intersection points on the unit sphere. The other point is on the opposite side of the sphere:
X1=L/|L|
X2=-X1
Step 4: express the intersection points in terms of lat/lon:
Given X=(x,y,z), using spherical coordinate conversion again, and taking into account the point is on the unit sphere:
lat=asin(z)
lon=atan2(y,x)
Step 5: which of the two points is closer?
Use the haversine formula to figure out the distance from your point to X1 and X2, choose the nearer one.
I think your best bet is to use stereographic projection to map the problem from the sphere to the plane. This projection is very useful in that it maps your rhumb line to a logarithmic spiral of form R=exp(θa) (aka a loxodrome) and maps your great circle to a circle on the plane. So your problem reduces to finding the intersection of a logarithmic spiral and a circle (after which you map back to the sphere).
This is just a sketch to get you started. If you need more details, just ask.