verintsupport
asked on
opposite of Atan2? in c# or in regular math
I have:
Pa.Lat_origin=Pa.Lat-Pb.La t;
Pa.Lng_origin=(Pa.Lng-Pb.L ng)*Math.C os(Pb.Lat* Math.PI/18 0);
(Math.Atan2(Pa.Lat_origin, Pa.Lng_ori gin))*180/ Math.PI = angle
I want to isolate angle....
Math.Atan2((Pa.Lat-Pb.Lat) ,((Pa.Lng- Pb.Lng)*Ma th.Cos(Pb. Lat*Math.P I/180))) = angle*Math.PI/180
How do i do the opposite of Atan2?
Basically this method is the one i use to find an angle....
Now i want to find a point based on an angle.
Thanks
Richard
Pa.Lat_origin=Pa.Lat-Pb.La
Pa.Lng_origin=(Pa.Lng-Pb.L
(Math.Atan2(Pa.Lat_origin,
I want to isolate angle....
Math.Atan2((Pa.Lat-Pb.Lat)
How do i do the opposite of Atan2?
Basically this method is the one i use to find an angle....
Now i want to find a point based on an angle.
Thanks
Richard
ASKER
angle in rad or in degree?
y = sin(angle)*distance
x = cos(angle)*distance
is good in a cartesian plan but in lat longs, i need to modify my long according to the lat
this is what i did when finding the angle.... how do i reverse that?
Pa.Lng_origin=(Pa.Lng-Pb.L ng)*Math.C os(Pb.Lat* Math.PI/18 0);
Maybe i'm complicating things to much....
y = sin(angle)*distance
x = cos(angle)*distance
is good in a cartesian plan but in lat longs, i need to modify my long according to the lat
this is what i did when finding the angle.... how do i reverse that?
Pa.Lng_origin=(Pa.Lng-Pb.L
Maybe i'm complicating things to much....
ASKER
i think i need to isolate Pa.Lat_origin and Pa.Lng_origin to find my answer
ASKER
so basically:
if Angle = (Math.Atan2(Pa.Lat_origin, Pa.Lng_ori gin))*180/ Math.PI
Pa.Lat_origin = ?
Pa.Lng_origin = ?
if Angle = (Math.Atan2(Pa.Lat_origin,
Pa.Lat_origin = ?
Pa.Lng_origin = ?
if Angle = (Math.Atan2(Pa.Lat_origin, Pa.Lng_ori gin))*180/ Math.PI
Pa.Lat_origin = distance*sin(Angle*Math.PI /180)
Pa.Lng_origin = distance*cos(Angle*Math.PI /180)
Pa.Lat_origin = distance*sin(Angle*Math.PI
Pa.Lng_origin = distance*cos(Angle*Math.PI
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok so i get:
So if the point i'm looking for is Pa then:
(distance*sin(Angle*Math.P I/180))+Pb .Lat = Pa.Lat
(distance*cos(Angle*Math.P I/180))/Ma th.Cos(Pb. Lat*Math.P I/180)+Pb. Lng = Pa.Lng
right?
So if the point i'm looking for is Pa then:
(distance*sin(Angle*Math.P
(distance*cos(Angle*Math.P
right?
y = sin(angle)*distance
x = cos(angle)*distance