rgl.sphline | R Documentation |
Given points on a sphere, these functions will draw the connecting great and minor circle minimum distance line connecting them.
rgl.sphline(long1, lat1, long2, lat2, radius = 1, deg = TRUE, col = "black", res = 1000,
...)
rgl.sphlines(long, lat, ...)
rgl.seglong(long1, long2, lat, radius=1, deg=TRUE, col='black', res=1000, ...)
rgl.seglat(long, lat1, lat2, radius=1, deg=TRUE, col='black', res=1000, ...)
rgl.segbox(long1, long2, lat1, lat2, radius=1, deg=TRUE, col='black', res=1000, ...)
long1 |
Numeric scalar; longitude of first location. |
lat1 |
Numeric scalar; latitude of first location. |
long2 |
Numeric scalar; longitude of second location. |
lat2 |
Numeric scalar; latitude of second location. |
long |
Numeric vector; longitudes on plotting path. |
lat |
Numeric vector; latitudes on plotting path. |
radius |
Numeric scalar; radius of segment to draw. |
deg |
Logical; specifies if input is in degrees (default) or radians. |
col |
Specifies line colour. |
res |
Numeric scalar; resolution of line to draw (how many elements in the total great circle). Only make this large if plotting points very close together, otherwise the default is generally high enough resolution. |
... |
Other arguments to pass to |
The main difference between rgl.sphline
and rgl.sphlines
is that the former takes scalar inputs but gives you the great outputs listed below, whilst rgl.sphlines
can take vector inputs and plot complicated paths, but provides no return from the function.
rgl.sphline
and rgl.sphlines
are called for the side effect of plotting on the current sphere.
rgl.seglong
draws longitude lines of constant latitude (technically minor circle arcs, except at the equator).
rgl.seglat
draws latitude lines of constant longitude (great circle arcs).
rgl.segbox
draws boxes with the specified longitude and latitude limits.
rgl.sphline
also returns various diagnostic outputs:
great_circle |
Cartesian coordinates of the full great circle. |
segment |
Cartesian coordinates of the great circlen segment. |
CrossEq |
Location where great circle crosses the equator. |
PeakDec |
Peak declination / latitude of the great circle. |
AngSep |
Angular separation of the two points in degrees. |
CrossProd |
Three element cross product vector for the two input positions. |
Aaron Robotham
rgl.sphglobe
rgl.sphglobe('world1')
rgl.sphline(20,30,40,60)
rgl.sphpoints(c(20,40), c(30,60), size=10)
rgl.sphline(340,-20,80,30)
rgl.sphpoints(c(340,80), c(-20,30), size=10)
rgl.sphline(30,40,80,-60)
rgl.sphpoints(c(30,80), c(40,-60), size=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.