Hi,
Thanks for people who have helped so far with this,
I want to draw a line in MapX between two points. The function in MapX
to do this takes two WGS-84 lat/long points.
I don't have two lat/long points. I have one lat/long, an angle in
degrees and a length in meters.
I need to calculate the second lat/long (unless there is a MapX function
that can draw a line - given a position, angle and distance).
A C++ algorithm to do it would be fine. I can't believe MapX doesn't
support such a calculation.
Tim
-----Original Message-----
From: Terry McDonnell [mailto:terry@martlet.uk.com]=20
Sent: 29 June 2004 15:42
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
Is your problem what algorithm to create to do this or how to do it Mapx
or code it in C++? IOW do you not know how to go about it?
Terry
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 29 June 2004 12:42
To: MapInfo-L@lists.directionsmag.com
Subject: MI-L New lat/long from distance/bearing
Hi List,
I have a latitude and longitude in WGS-84.
I want to calculate a new point based on a bearing and distance from
this position.
Difficult bit -
I want to calculate this using MapX, or alternatively I could use some
C/C++ code.
Thanks for any help with this
Kind regards
Tim Smith
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12390
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12395
There are actually some lengthy discussions / debates that can be =
started
but here goes:
You need to define a little more detail about your objectives, =
specifically
your purpose and accuracy requirements.
This is not my recommendation; given the computing power that is =
generally
available you don't save anything, but....
IF (ALL CONDITIONS APPLY)
1) The points are "close" together within 2 Km, and=20
2) Precision is not critical, an error of a few meters is acceptable, =
and
3) You are not further North than say about 50 degrees Latitude=20
(this might be pushing it)
You could actually use simple planer polar geometry functions =
(Pathagorean).
Approx error =3D (distance_between_points / Radii_of_Earth)^2.
As the points separate (become further apart) and/or you move to more
Northern latitudes. Forget doing this.
To determine the position of a point on a spherical model Use "Great =
Circle"
calculations. The formula are designed to compute locations using a =
SPHERE,
Technically not The WGS84 Ellipsoid but the error is low enough that it =
is
generally considered acceptable with the following exceptions:
1) If you are measuring distances that subtend an angle > 180 degrees =
(half
the circumference of the globe) the cumulative error may not be =
acceptable.
This is something you would need to investigate. For example, =
determining
distances between cities > 180 degrees apart would generally be =
acceptable
for something like "trip planning", but I wouldn't necessarily determine =
my
aircrafts fuel requirement without using a generous safety factor.
2) If you require high positional accuracy (sub meter or survey =
precision)
then you should transform to a different coordinate system (datum) that
models the earth surface as a plane and use appropriate formula. Get =
out
your surveyors text and go from there.
Great Circle Calculations:
All Angles, Coordinates, and Length need to be converted to RADIAN =
measures:
Conversions:
angle_radians =3D (pi/180) * angle_degrees
angle_degrees =3D (180/pi) * angle_radians
Why Nautical Mile - It is convenient in its definition: =20
1 Nautical Mile =3D 1 minute of arc (1/60 of a degree)
Current value =3D 1852 meters or 1.852 km
This is convenient when using WGS84 Ellipsoid (and other similar ones) =
as it
lies between the equatorial and polar measures. That is:
if 1 nautical mile =3D 1.852 km,=20
then the radii of the SPHERE, R =3D 1.852*(180*60/pi) =3D 6366.707 km =
=20
WGS84
Equatorial Radii =3D 6378.137 km
Polar Radii =3D 6356.752 km
OR
Test your MOD() function (it should work correctly, but there are some
implementation differences):
Mod(m,n)
Mod(340,60) =3D 40
Mod(-340,60) =3D 20
If MOD function not available, or does not work as expected:
mod =3D ((longitude1 - d_lon + pi) - (2*pi)) *=20
int(longitude1 - d_lon + pi /2*pi)
IF ( mod < 0 ) mod =3D mod + (2*pi)
Dest_lon =3D mod - pi
In Java I think you use the "%" op (I have not tested this)
Dest_lon =3D ((longitude1 - d_lon + pi) % (2*pi)) - pi
WHERE:
Dest_lat =3D destination point latitude, radians
Dest_lno =3D destination point longitude, radians
Latitude1, Longitude1 =3D The coordinates of the starting point, radians
Dist =3D The distance (length) along the lateral from the start point, =
radians
Heading =3D the direction of travel from true north, radians
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: Tuesday, June 29, 2004 08:56 AM
To: terry@martlet.uk.com; mapinfo-l@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Hi,
Thanks for people who have helped so far with this,
I want to draw a line in MapX between two points. The function in MapX
to do this takes two WGS-84 lat/long points.
I don't have two lat/long points. I have one lat/long, an angle in
degrees and a length in meters.
I need to calculate the second lat/long (unless there is a MapX function
that can draw a line - given a position, angle and distance).
A C++ algorithm to do it would be fine. I can't believe MapX doesn't
support such a calculation.
Tim
-----Original Message-----
From: Terry McDonnell [mailto:terry@martlet.uk.com]=20
Sent: 29 June 2004 15:42
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
Is your problem what algorithm to create to do this or how to do it Mapx
or code it in C++? IOW do you not know how to go about it?
Terry
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 29 June 2004 12:42
To: MapInfo-L@lists.directionsmag.com
Subject: MI-L New lat/long from distance/bearing
Hi List,
I have a latitude and longitude in WGS-84.
I want to calculate a new point based on a bearing and distance from
this position.
Difficult bit -
I want to calculate this using MapX, or alternatively I could use some
C/C++ code.
Thanks for any help with this
Kind regards
Tim Smith
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12390
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12395
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12415
I will try this.
I'll post up how I got on when I do the work.
Kind regards
Tim
-----Original Message-----
From: Uffe Kousgaard [mailto:uffe@routeware.dk]=20
Sent: 29 June 2004 16:18
To: Mapinfo-L
Subject: Re: MI-L New lat/long from distance/bearing
Look here: http://williams.best.vwh.net/avform.htm#LL and remember to
read the top notes about using radians.
Kind regards
Uffe Kousgaard
www.routeware.dk
----- Original Message -----=20
From: "Tim Smith" <tsmith@micromill.com>
A C++ algorithm to do it would be fine. I can't believe MapX doesn't
support such a calculation.
Tim
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12396
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12427
I'm not 100% sure, but with this approach I'd need my easting/northing
to be in the same units as the distance.
Is this correct?
My lat/long is WGS84 and my distance is in meters.
Kind regards
Tim Smith
-----Original Message-----
From: Terry McDonnell [mailto:terry@martlet.uk.com]=20
Sent: 29 June 2004 16:27
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
Tim,
I don't know MapX and would need repriming on C, and I'm not sure if
there is a ready-made function to do this, but I would use trig to do
this
N
!
! w target
-!-----o
! /
n! /
!b / L
! /
!/ 90-b
-o-----!-------- W
w
Start point
You have bearing, angle b, and distance, length L
Sin( b) =3D Opp/Hyp
So Sin( b) =3D w / L
So w =3D Sin( b) * L, giving you your distance West
Tan( b) =3D Opp/Adj
So Tan( b) =3D w / n
So n =3D Tan( b) * w, giving you your distance North
This works for bearings of < 90 deg so will need to be rethought for >
180, > 270 etc. but I'm sure you get the drift. As to whether MapX has
functions to get the lat/long, given the distances N and W, I don't
know, but I hope this helps
Terry
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 29 June 2004 15:56
To: terry@martlet.uk.com; mapinfo-l@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Hi,
Thanks for people who have helped so far with this,
I want to draw a line in MapX between two points. The function in MapX
to do this takes two WGS-84 lat/long points. I don't have two lat/long
points. I have one lat/long, an angle in degrees and a length in meters.
I need to calculate the second lat/long (unless there is a MapX function
that can draw a line - given a position, angle and distance).
A C++ algorithm to do it would be fine. I can't believe MapX doesn't
support such a calculation.
Tim
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12428
I may use some of your ideas to help me solve this.
My application is in C++ using MapX, so I have to use the functions
available in MapX. The calculation has to be done in code and quickly.
I was thinking I could use your idea of converting the point to a meter
grid point and then applying trig to get the second point and then
converting the new point back to WGS84.
The trig part is ok.
I now need to know how to convert between WGS84 lat/long and a meter
system - probably UTM.
Does anyone know how this is done?
Cheers
Tim
-----Original Message-----
From: Lars V. Nielsen (GisPro) [mailto:LVN@gispro.dk]=20
Sent: 29 June 2004 16:45
To: Tim Smith
Cc: MapInfo-L@lists.directionsmag.com
Subject: Re: MI-L New lat/long from distance/bearing
Hi Tim,
If you don't want to go all out on formula gymnatics, I may have an idea
for you.
By using the coordinate support in MapInfo to my advantage, I've
implemented adding meter offsets to GPS positions this way :
1. Set the coordsys to LatLong/WGS84, and obtain the coordinates of the
point (user click in my case) 2. Switch the coordsys to a meters based
stereographic projection with the lat/long point as center, i.e. as
(0,0) 3. Create a new point feature using simple 2D geometry, e.g. 300
meters east, 200 meters south, i.e. in stereographic position
(300,-200)
4. Switch back to LatLong/WGS84, and retrieve the coordinate of the
created point feature 5. Voila, you've had MapInfo calculate a flat
offset to a geographic position.
It was implemented in Pro/MapBasic, which is far better at this this
MapX. But even in MapX you can manipulate the coordinate system setting
to your advantage, and you can create point features on the fly, so it
ought to be possible even in MapX to use the above method.
And yes, it's an approximate method that deteriorates with distance, but
for smaller offsets it should be perfectly ok to use.
Good luck.
Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
----- Original Message -----=20
From: "Tim Smith" <tsmith@micromill.com>
To: <MapInfo-L@lists.directionsmag.com>
Sent: Tuesday, June 29, 2004 1:42 PM
Subject: MI-L New lat/long from distance/bearing
Hi List,
I have a latitude and longitude in WGS-84.
I want to calculate a new point based on a bearing and distance from
this position.
Difficult bit -
I want to calculate this using MapX, or alternatively I could use some
C/C++ code.
Thanks for any help with this
Kind regards
Tim Smith
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12390
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12429
This is fine. But I need to know how to convert from WGS84 lat-long into
a meter grid so I can do the trig.
Tim
-----Original Message-----
From: Nielsen, Erik R [mailto:Erik.R.Nielsen@atkinsglobal.com]=20
Sent: 29 June 2004 15:59
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
X2=3D x1 + L * sin(ang)
Y2 =3D Y1+ L* cos(ang)
Or switch sin or Cos if it doesn't look right, don't test with 45 degree
angle, test with zero or 90. Best regards Erik
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 29 June 2004 15:56
To: terry@martlet.uk.com; mapinfo-l@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Hi,
Thanks for people who have helped so far with this,
I want to draw a line in MapX between two points. The function in MapX
to do this takes two WGS-84 lat/long points. I don't have two lat/long
points. I have one lat/long, an angle in degrees and a length in meters.
I need to calculate the second lat/long (unless there is a MapX function
that can draw a line - given a position, angle and distance).
A C++ algorithm to do it would be fine. I can't believe MapX doesn't
support such a calculation.
Tim
-----Original Message-----
From: Terry McDonnell [mailto:terry@martlet.uk.com]=20
Sent: 29 June 2004 15:42
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
Is your problem what algorithm to create to do this or how to do it Mapx
or code it in C++? IOW do you not know how to go about it?
Terry
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 29 June 2004 12:42
To: MapInfo-L@lists.directionsmag.com
Subject: MI-L New lat/long from distance/bearing
Hi List,
I have a latitude and longitude in WGS-84.
I want to calculate a new point based on a bearing and distance from
this position.
Difficult bit -
I want to calculate this using MapX, or alternatively I could use some
C/C++ code.
Thanks for any help with this
Kind regards
Tim Smith
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12390
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12395
This email and any attached files are confidential and copyright
protected. If you are not the addressee, any dissemination of this
communication is strictly prohibited. Unless otherwise expressly agreed
in writing, nothing stated in this communication shall be legally
binding.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12430
I am also working over small spaces (< 100km area), so I could use
normal trig as you mention. But I must first convert the lat/long to a
meter grid because my distance is in meters. This is because X2=3D x1 + =
L
* sin(ang) will mean nothing if x1 is in decimal degrees and L is in
meters.
Kind regards
Tim
-----Original Message-----
From: Nielsen, Erik R [mailto:Erik.R.Nielsen@atkinsglobal.com]=20
Sent: 02 July 2004 09:43
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
Tim,
I've been following this with interest. I don't know MapX that well and
I'm normally working with smaller areas, that can be assumed euklidean
spaces (even if in lat-long). I liked Uffe's link, and those
calculations should work fine. Sorry not to be of more help.=20
Cheers
Erik
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 02 July 2004 09:36
To: MapInfo-L@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Hi Erik,
This is fine. But I need to know how to convert from WGS84 lat-long into
a meter grid so I can do the trig.
Tim
This email and any attached files are confidential and copyright
protected. If you are not the addressee, any dissemination of this
communication is strictly prohibited. Unless otherwise expressly agreed
in writing, nothing stated in this communication shall be legally
binding.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
X2=3D x1 + L * sin(ang)
Y2 =3D Y1+ L* cos(ang)
Or switch sin or Cos if it doesn't look right, don't test with 45 degree
angle, test with zero or 90. Best regards Erik
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 29 June 2004 15:56
To: terry@martlet.uk.com; mapinfo-l@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Hi,
Thanks for people who have helped so far with this,
I want to draw a line in MapX between two points. The function in MapX
to do this takes two WGS-84 lat/long points. I don't have two lat/long
points. I have one lat/long, an angle in degrees and a length in meters.
I need to calculate the second lat/long (unless there is a MapX function
that can draw a line - given a position, angle and distance).
A C++ algorithm to do it would be fine. I can't believe MapX doesn't
support such a calculation.
Tim
-----Original Message-----
From: Terry McDonnell [mailto:terry@martlet.uk.com]=20
Sent: 29 June 2004 15:42
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
Is your problem what algorithm to create to do this or how to do it Mapx
or code it in C++? IOW do you not know how to go about it?
Terry
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 29 June 2004 12:42
To: MapInfo-L@lists.directionsmag.com
Subject: MI-L New lat/long from distance/bearing
Hi List,
I have a latitude and longitude in WGS-84.
I want to calculate a new point based on a bearing and distance from
this position.
Difficult bit -
I want to calculate this using MapX, or alternatively I could use some
C/C++ code.
Thanks for any help with this
Kind regards
Tim Smith
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12390
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12395
This email and any attached files are confidential and copyright
protected. If you are not the addressee, any dissemination of this
communication is strictly prohibited. Unless otherwise expressly agreed
in writing, nothing stated in this communication shall be legally
binding.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12431
Tim
What sort of accuracy do you need? You talk about less than 100km =
distances,
but is accuracy to +/- 20m or to +/- 1m what you can tolerate?
Ian Thomas
GeoSciSoft - Perth, Australia
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: Friday, 2 July 2004 4:57 PM
> To: Nielsen, Erik R
> Cc: MapInfo-L@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
> Erik,
>=20
> Thanks for your reply.
>=20
> I am also working over small spaces (< 100km area), so I could use
> normal trig as you mention. But I must first convert the lat/long to a
> meter grid because my distance is in meters. This is because X2=3D x1 =
+ L
> * sin(ang) will mean nothing if x1 is in decimal degrees and L is in
> meters.
>=20
> Kind regards
>=20
> Tim
>=20
> -----Original Message-----
> From: Nielsen, Erik R [mailto:Erik.R.Nielsen@atkinsglobal.com]
> Sent: 02 July 2004 09:43
> To: Tim Smith
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Tim,
> I've been following this with interest. I don't know MapX that well =
and
> I'm normally working with smaller areas, that can be assumed euklidean
> spaces (even if in lat-long). I liked Uffe's link, and those
> calculations should work fine. Sorry not to be of more help.
> Cheers
> Erik
>=20
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 02 July 2004 09:36
> To: MapInfo-L@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi Erik,
>=20
> This is fine. But I need to know how to convert from WGS84 lat-long =
into
> a meter grid so I can do the trig.
>=20
> Tim
>=20
>=20
> This email and any attached files are confidential and copyright
> protected. If you are not the addressee, any dissemination of this
> communication is strictly prohibited. Unless otherwise expressly =
agreed
> in writing, nothing stated in this communication shall be legally
> binding.
>=20
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>=20
>=20
> X2=3D x1 + L * sin(ang)
> Y2 =3D Y1+ L* cos(ang)
>=20
> Or switch sin or Cos if it doesn't look right, don't test with 45 =
degree
> angle, test with zero or 90. Best regards Erik
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 29 June 2004 15:56
> To: terry@martlet.uk.com; mapinfo-l@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi,
> Thanks for people who have helped so far with this,
>=20
> I want to draw a line in MapX between two points. The function in MapX
> to do this takes two WGS-84 lat/long points. I don't have two lat/long
> points. I have one lat/long, an angle in degrees and a length in =
meters.
> I need to calculate the second lat/long (unless there is a MapX =
function
> that can draw a line - given a position, angle and distance).
>=20
> A C++ algorithm to do it would be fine. I can't believe MapX doesn't
> support such a calculation.
>=20
> Tim
>=20
>=20
>=20
> -----Original Message-----
> From: Terry McDonnell [mailto:terry@martlet.uk.com]
> Sent: 29 June 2004 15:42
> To: Tim Smith
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Is your problem what algorithm to create to do this or how to do it =
Mapx
> or code it in C++? IOW do you not know how to go about it?
>=20
> Terry
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 29 June 2004 12:42
> To: MapInfo-L@lists.directionsmag.com
> Subject: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi List,
>=20
> I have a latitude and longitude in WGS-84.
> I want to calculate a new point based on a bearing and distance from
> this position.
>=20
> Difficult bit -
> I want to calculate this using MapX, or alternatively I could use some
> C/C++ code.
>=20
> Thanks for any help with this
>=20
> Kind regards
>=20
> Tim Smith
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail: =
mapinfo-l-help@lists.directionsmag.com
> Message number: 12390
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail: =
mapinfo-l-help@lists.directionsmag.com
> Message number: 12395
>=20
>=20
> This email and any attached files are confidential and copyright
> protected. If you are not the addressee, any dissemination of this
> communication is strictly prohibited. Unless otherwise expressly =
agreed
> in writing, nothing stated in this communication shall be legally
> binding.
>=20
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail: =
mapinfo-l-help@lists.directionsmag.com
> Message number: 12431
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12432
The further the distance, the less accurate it needs to be.
So +/- 1 degree is probably the best way to represent the accuracy I
need.
e.g. roughly +/- 1.7km @ 100km and 1.7m @ 100m etc.
Cheers
Tim
-----Original Message-----
From: SCISOFT [mailto:geoscisoft@iinet.net.au]=20
Sent: 02 July 2004 10:15
To: Tim Smith; 'Nielsen, Erik R'
Cc: MapInfo-L@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Tim
What sort of accuracy do you need? You talk about less than 100km
distances, but is accuracy to +/- 20m or to +/- 1m what you can
tolerate?
Ian Thomas
GeoSciSoft - Perth, Australia
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: Friday, 2 July 2004 4:57 PM
> To: Nielsen, Erik R
> Cc: MapInfo-L@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
> Erik,
>=20
> Thanks for your reply.
>=20
> I am also working over small spaces (< 100km area), so I could use=20
> normal trig as you mention. But I must first convert the lat/long to a
> meter grid because my distance is in meters. This is because X2=3D x1 =
+=20
> L
> * sin(ang) will mean nothing if x1 is in decimal degrees and L is in
> meters.
>=20
> Kind regards
>=20
> Tim
>=20
> -----Original Message-----
> From: Nielsen, Erik R [mailto:Erik.R.Nielsen@atkinsglobal.com]
> Sent: 02 July 2004 09:43
> To: Tim Smith
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Tim,
> I've been following this with interest. I don't know MapX that well=20
> and I'm normally working with smaller areas, that can be assumed=20
> euklidean spaces (even if in lat-long). I liked Uffe's link, and those
> calculations should work fine. Sorry not to be of more help. Cheers
> Erik
>=20
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 02 July 2004 09:36
> To: MapInfo-L@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi Erik,
>=20
> This is fine. But I need to know how to convert from WGS84 lat-long=20
> into a meter grid so I can do the trig.
>=20
> Tim
>=20
>=20
> This email and any attached files are confidential and copyright=20
> protected. If you are not the addressee, any dissemination of this=20
> communication is strictly prohibited. Unless otherwise expressly=20
> agreed in writing, nothing stated in this communication shall be=20
> legally binding.
>=20
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.=20
> For more information please visit http://www.messagelabs.com/email=20
> ______________________________________________________________________
>=20
>=20
> X2=3D x1 + L * sin(ang)
> Y2 =3D Y1+ L* cos(ang)
>=20
> Or switch sin or Cos if it doesn't look right, don't test with 45=20
> degree angle, test with zero or 90. Best regards Erik
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 29 June 2004 15:56
> To: terry@martlet.uk.com; mapinfo-l@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi,
> Thanks for people who have helped so far with this,
>=20
> I want to draw a line in MapX between two points. The function in MapX
> to do this takes two WGS-84 lat/long points. I don't have two lat/long
> points. I have one lat/long, an angle in degrees and a length in=20
> meters. I need to calculate the second lat/long (unless there is a=20
> MapX function that can draw a line - given a position, angle and=20
> distance).
>=20
> A C++ algorithm to do it would be fine. I can't believe MapX doesn't=20
> support such a calculation.
>=20
> Tim
>=20
>=20
>=20
> -----Original Message-----
> From: Terry McDonnell [mailto:terry@martlet.uk.com]
> Sent: 29 June 2004 15:42
> To: Tim Smith
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Is your problem what algorithm to create to do this or how to do it=20
> Mapx or code it in C++? IOW do you not know how to go about it?
>=20
> Terry
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 29 June 2004 12:42
> To: MapInfo-L@lists.directionsmag.com
> Subject: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi List,
>=20
> I have a latitude and longitude in WGS-84.
> I want to calculate a new point based on a bearing and distance from=20
> this position.
>=20
> Difficult bit -
> I want to calculate this using MapX, or alternatively I could use some
> C/C++ code.
>=20
> Thanks for any help with this
>=20
> Kind regards
>=20
> Tim Smith
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail:=20
> mapinfo-l-help@lists.directionsmag.com
> Message number: 12390
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.=20
> For more information please visit http://www.messagelabs.com/email=20
> ______________________________________________________________________
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail:=20
> mapinfo-l-help@lists.directionsmag.com
> Message number: 12395
>=20
>=20
> This email and any attached files are confidential and copyright=20
> protected. If you are not the addressee, any dissemination of this=20
> communication is strictly prohibited. Unless otherwise expressly=20
> agreed in writing, nothing stated in this communication shall be=20
> legally binding.
>=20
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.=20
> For more information please visit http://www.messagelabs.com/email=20
> ______________________________________________________________________
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail:=20
> mapinfo-l-help@lists.directionsmag.com
> Message number: 12431
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12433
I understand what you're saying. I still need to be able to convert from
my lat/long to meters before I can use the trig.
E.g.
My latitude is 50.9051 degrees and longitude is -1.0649 degrees. My
angle is 45 degrees and my distance is 500m.
If I use the trig as it stands I would get a target of.
Latitude X2 =3D 50.9051 + 500 * sin(45) =3D 404.46
This is incorrect.
What I need to do is convert my lat/long into a meter grid - lets say
UTM.
I now have 636056 easting and 5641055 northing
Now the trig works
X2 =3D 5641055 + 500 * sin(45) =3D 5641409
Now convert back to degrees.
50.9083
What I need to be able to do is convert from my position in degrees to a
meter system.
Cheers
Tim
-----Original Message-----
From: Nielsen, Erik R [mailto:Erik.R.Nielsen@atkinsglobal.com]=20
Sent: 02 July 2004 11:21
To: Tim Smith
Subject: RE: MI-L New lat/long from distance/bearing
Tim,
Here's an idea.
Can you just create a line of any odd length but pointing in the right
direction=20
( that's my X2=3D x1 + L * sin(ang) which as you point out isn't making =
a
lot of sense (but use Deg_2_RAD conversion and it will)) Now get the
length MeterL of this object in meters (that should be possible even
with MapX) Now you wil have a L to meter conversion in the part of the
globe where you are (L/MeterL) You can now create a new line with the
right L and the right Direction.)
Is this an idea you can use?
Best regards
Erik
-----Original Message-----
From: Tim Smith [mailto:tsmith@micromill.com]=20
Sent: 02 July 2004 10:48
To: SCISOFT; Nielsen, Erik R
Cc: MapInfo-L@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Ian,
The further the distance, the less accurate it needs to be.
So +/- 1 degree is probably the best way to represent the accuracy I
need. e.g. roughly +/- 1.7km @ 100km and 1.7m @ 100m etc.
Cheers
Tim
-----Original Message-----
From: SCISOFT [mailto:geoscisoft@iinet.net.au]=20
Sent: 02 July 2004 10:15
To: Tim Smith; 'Nielsen, Erik R'
Cc: MapInfo-L@lists.directionsmag.com
Subject: RE: MI-L New lat/long from distance/bearing
Tim
What sort of accuracy do you need? You talk about less than 100km
distances, but is accuracy to +/- 20m or to +/- 1m what you can
tolerate?
Ian Thomas
GeoSciSoft - Perth, Australia
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: Friday, 2 July 2004 4:57 PM
> To: Nielsen, Erik R
> Cc: MapInfo-L@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
> Erik,
>=20
> Thanks for your reply.
>=20
> I am also working over small spaces (< 100km area), so I could use=20
> normal trig as you mention. But I must first convert the lat/long to a
> meter grid because my distance is in meters. This is because X2=3D x1 =
+=20
> L
> * sin(ang) will mean nothing if x1 is in decimal degrees and L is in=20
> meters.
>=20
> Kind regards
>=20
> Tim
>=20
> -----Original Message-----
> From: Nielsen, Erik R [mailto:Erik.R.Nielsen@atkinsglobal.com]
> Sent: 02 July 2004 09:43
> To: Tim Smith
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Tim,
> I've been following this with interest. I don't know MapX that well=20
> and I'm normally working with smaller areas, that can be assumed=20
> euklidean spaces (even if in lat-long). I liked Uffe's link, and those
> calculations should work fine. Sorry not to be of more help. Cheers
> Erik
>=20
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 02 July 2004 09:36
> To: MapInfo-L@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi Erik,
>=20
> This is fine. But I need to know how to convert from WGS84 lat-long=20
> into a meter grid so I can do the trig.
>=20
> Tim
>=20
>=20
> This email and any attached files are confidential and copyright=20
> protected. If you are not the addressee, any dissemination of this=20
> communication is strictly prohibited. Unless otherwise expressly=20
> agreed in writing, nothing stated in this communication shall be=20
> legally binding.
>=20
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.=20
> For more information please visit http://www.messagelabs.com/email=20
> ______________________________________________________________________
>=20
>=20
> X2=3D x1 + L * sin(ang)
> Y2 =3D Y1+ L* cos(ang)
>=20
> Or switch sin or Cos if it doesn't look right, don't test with 45=20
> degree angle, test with zero or 90. Best regards Erik
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 29 June 2004 15:56
> To: terry@martlet.uk.com; mapinfo-l@lists.directionsmag.com
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi,
> Thanks for people who have helped so far with this,
>=20
> I want to draw a line in MapX between two points. The function in MapX
> to do this takes two WGS-84 lat/long points. I don't have two lat/long
> points. I have one lat/long, an angle in degrees and a length in=20
> meters. I need to calculate the second lat/long (unless there is a=20
> MapX function that can draw a line - given a position, angle and=20
> distance).
>=20
> A C++ algorithm to do it would be fine. I can't believe MapX doesn't=20
> support such a calculation.
>=20
> Tim
>=20
>=20
>=20
> -----Original Message-----
> From: Terry McDonnell [mailto:terry@martlet.uk.com]
> Sent: 29 June 2004 15:42
> To: Tim Smith
> Subject: RE: MI-L New lat/long from distance/bearing
>=20
>=20
> Is your problem what algorithm to create to do this or how to do it=20
> Mapx or code it in C++? IOW do you not know how to go about it?
>=20
> Terry
>=20
> -----Original Message-----
> From: Tim Smith [mailto:tsmith@micromill.com]
> Sent: 29 June 2004 12:42
> To: MapInfo-L@lists.directionsmag.com
> Subject: MI-L New lat/long from distance/bearing
>=20
>=20
> Hi List,
>=20
> I have a latitude and longitude in WGS-84.
> I want to calculate a new point based on a bearing and distance from=20
> this position.
>=20
> Difficult bit -
> I want to calculate this using MapX, or alternatively I could use some
> C/C++ code.
>=20
> Thanks for any help with this
>=20
> Kind regards
>=20
> Tim Smith
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail:=20
> mapinfo-l-help@lists.directionsmag.com
> Message number: 12390
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.=20
> For more information please visit http://www.messagelabs.com/email=20
> ______________________________________________________________________
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail:=20
> mapinfo-l-help@lists.directionsmag.com
> Message number: 12395
>=20
>=20
> This email and any attached files are confidential and copyright=20
> protected. If you are not the addressee, any dissemination of this=20
> communication is strictly prohibited. Unless otherwise expressly=20
> agreed in writing, nothing stated in this communication shall be=20
> legally binding.
>=20
>=20
>=20
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.=20
> For more information please visit http://www.messagelabs.com/email=20
> ______________________________________________________________________
>=20
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
> For additional commands, e-mail:=20
> mapinfo-l-help@lists.directionsmag.com
> Message number: 12431
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12433
This message has been scanned for viruses by BlackSpider MailControl -
www.blackspider.com
This email and any attached files are confidential and copyright
protected. If you are not the addressee, any dissemination of this
communication is strictly prohibited. Unless otherwise expressly agreed
in writing, nothing stated in this communication shall be legally
binding.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12434
<snip>
What I need to be able to do is convert from my position in degrees to a
meter system.
</snip>
If you want to do that, you will find the formulas here
(http://www.gpsy.com/gpsinfo/geotoutm/), but it is much more complicated
than doing the calculations, I suggested:
lat1 = 50.9051 degrees = 50.9051 / 180 * pi radians = 0.88846 radians
lon1 = -1.0649 degrees = -0.018586 radians
tc = 45 degrees = 0.785398 radians
d = 500m = 500 m / 6378130 m = 0.000078392 radians
lat=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
IF (cos(lat)=0)
lon=lon1 // endpoint a pole
ELSE
lon=mod(lon1-asin(sin(tc)*sin(d)/cos(lat))+pi,2*pi)-pi
ENDIF
I get these values as result:
lat = 50.908275919285
lon = -1.06993680690127
Now I entered these 2 points into a TAB file and measured the distance
and get 500 meter as expected.
Kind regards
Uffe Kousgaard
www.routeware.dk
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12436
The example was a great help.
I will probably use the way you mention, although I did find another way
to do it, but which only works over small areas.
lat =3D latitude of first point
long =3D longitude of firat point
angle =3D angle in degrees or radians
dist =3D distance to go from lat/long in meters
-----Original Message-----
From: Uffe Kousgaard [mailto:uffe@routeware.dk]=20
Sent: 02 July 2004 14:09
To: Mapinfo-L
Subject: Re: MI-L New lat/long from distance/bearing
From: "Tim Smith" <tsmith@micromill.com>
<snip>
What I need to be able to do is convert from my position in degrees to a
meter system. </snip>
If you want to do that, you will find the formulas here
(http://www.gpsy.com/gpsinfo/geotoutm/), but it is much more complicated
than doing the calculations, I suggested:
lat=3Dasin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
IF (cos(lat)=3D0)
lon=3Dlon1 // endpoint a pole
ELSE
lon=3Dmod(lon1-asin(sin(tc)*sin(d)/cos(lat))+pi,2*pi)-pi
ENDIF
I get these values as result:
lat =3D 50.908275919285
lon =3D -1.06993680690127
Now I entered these 2 points into a TAB file and measured the distance
and get 500 meter as expected.
Kind regards
Uffe Kousgaard
www.routeware.dk
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12436
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email=20
______________________________________________________________________
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: mapinfo-l-unsubscribe@lists.directionsmag.com
For additional commands, e-mail: mapinfo-l-help@lists.directionsmag.com
Message number: 12437
Advertisers
Poll
What's driving interest in the cloud computing at your organization?