OS OpenSpace [logo]

OS OpenSpace Forum » OS OpenSpace » Newbie Area

Thread: Calculate intersection of 2 points

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 6 - Pages: 1 - Last Post: 11-May-2011 21:58 by: cmasters2002
cmasters2002

Posts: 18
Registered: 28/11/09
Calculate intersection of 2 points
Posted: 09-May-2011 08:51
  Click to reply to this thread Reply

Hi all

I have 2 OS grid ref's with bearing's coming from them, I need to calculate a 3rd point(intersection of bearing's from point 1,2) to place a marker on a map but cannot figure out how to calculate the 3rd point

EG

Point 1 - E391300 N157935 bearing 130 deg
Point 2 - E391850 N151560 beaing 45 deg
Pont 3 -????

Could anyone teLl me how to calculate point 3 or point me in the right direction


Thanks


Colin

chadwickBill

Posts: 390
Registered: 07/02/08
Re: Calculate intersection of 2 points
Posted: 10-May-2011 13:17   in response to: cmasters2002
  Click to reply to this thread Reply

You can use simple trig

cmasters2002

Posts: 18
Registered: 28/11/09
Re: Calculate intersection of 2 points
Posted: 10-May-2011 18:01   in response to: chadwickBill
  Click to reply to this thread Reply

Trig may be simple to some people but not to me :-)

Could you give me an example of how to do this with trig

thanks

colin

chadwickBill

Posts: 390
Registered: 07/02/08
Re: Calculate intersection of 2 points
Posted: 11-May-2011 19:34   in response to: cmasters2002
  Click to reply to this thread Reply

try here as a start

http://en.wikipedia.org/wiki/Line-line_intersection

chadwickBill

Posts: 390
Registered: 07/02/08
Re: Calculate intersection of 2 points
Posted: 11-May-2011 20:02   in response to: chadwickBill
  Click to reply to this thread Reply

Actually this might be more helpfull to you

http://en.wikipedia.org/wiki/Triangulation

You can use OpenLayers.Geometry.Point.distanceTo to get the distance between your two points.

chadwickBill

Posts: 390
Registered: 07/02/08
Re: Calculate intersection of 2 points
Posted: 11-May-2011 20:24   in response to: chadwickBill
  Click to reply to this thread Reply

and

dx = eastings1 - eastings2;
dy = -(northings1 - northings2); // allow for north increasing up
bearing = (Math.atan2(dy, dx) * 180.0 / Math.PI) - 90.0;

to find the compass bearing in degrees between your two points and so two of the angles of your triangle.

Then as you know two angles and one side ...

http://oakroadsystems.com/twt/solving.htm

cmasters2002

Posts: 18
Registered: 28/11/09
Re: Calculate intersection of 2 points
Posted: 11-May-2011 21:58   in response to: chadwickBill
  Click to reply to this thread Reply

Hi as mentioned I am certainly know maths expert, and am a bit unsure at what you are getting at?

if possible could you elaborate more on your answer as I know the XY of point 1 and 2 and also the bearings from north. I need to calculate the intersecion of the projected lines from the bearings of both points and return point 3

thanks

colin

Legend
Expert: 51 - 1000 pts
Advanced: 31 - 50 pts
Intermediate: 16 - 30 pts
Novice: 5 - 15 pts
Newbie: 0 - 4 pts
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums