Spherical functions for Euler.

Load this file with "load spherical"

functionspoint(pos:vector)

Get point on the sqhere from [lat,long] with N>0, S<0, E>0, W<0 Returns a 1x3 vector File: spherical

functionsposprint(pos:vector, sec:integer=0)

Print [lat,long] in usual form sec=1 : use DMS Returns a string File: spherical

functionsposition(point:vector)

Convert a point on the sphere to a position [lat,long] Returns a 1x2 vector File: spherical

functionsvector(frompos:vector, topos:vector)

Difference vector of two positions [lat,long] on an ideal ball. Note that following the direction will not reach the destination exactly. Returns [direction,distance], both in radians. File: spherical See:

saddvector (Spherical Functions)

functionsangle(A:vector, B:vector, C:vector)

Compute the angle ABC at B on a perfect sphere. File: spherical

functionstrianglearea(A:vector, B:vector, C:vector)

Compute the area of a triangle in space. File: spherical

functionsarea(A:vector, B:vector, C:vector)

Compute the area of a triangle on a perfect sphere. File: spherical

functionesarea(A:vector, B:vector, C:vector)

Compute the area of a triangle on the earth For small triangles this is not very accurate. File: spherical

functionesdist(frompos:vector, topos:vector)

Distance of two positions [lat,long] on the earth. This functions uses an average earth radius between the two points. esdist (earth spherical distance). Return distance in m File: spherical

functionesdir(frompos:vector, topos:vector)

Heading between two positions [lat,long] on the earth. esdirection (earth spherical direction). Return distance in m File: spherical

functionskmprint(x) := print(x/km$,digits=3,unit="km")

functionsdegprint(x) := print(deg(x),digits=2,unit="°")

functionsaddvector(pos:vector, heading:vector)

Add a vector v to a position, all elements in degrees. This would be the position, which you see in that distance under that heading from the position pos. Returns the new position. File: spherical See:

svector (Spherical Functions)

functionesadd(pos:vector, direction:number, distance:number)

Add a distance into the direction on the surface of the earth This will only work exactly for small distances. Returns the new postion File: spherical See:

saddvector (Spherical Functions)

functionnavigate(P1:vector, P2:vector, n:index=10)

Navigate from p1 to p2 Prints a series of GPS positions and headings to follow.

functionplotearth(lat=-90:30:90, long=0:30:330, labels=1)

Plots the earth with a grid of coordinates File: spherical

functionplotpos(pos:vector, label="", style="o", col=1)

Plot a postion and a label File: spherical

functionplotposline(pos, thickness=2, color=1)

Plot a line of positions File: spherical