Package uk.ac.starlink.ttools.plot2.geom
Class SphereNet
java.lang.Object
uk.ac.starlink.ttools.plot2.geom.SphereNet
Calculates line segments forming longitude and latitude lines
for a sphere around the data origin of a cube surface.
- Since:
- 15 Aug 2018
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents a set of 3-d points that can be joined together to make a grid line. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns a reasonable radius for the sphere if none is explicitly specified.getLatitudeLines
(double dRadius, int nLat) Returns an array of line specifications representing lines of latitude.getLongitudeLines
(double dRadius, int nLon) Returns an array of line specifications representing lines of longitude.
-
Constructor Details
-
SphereNet
Constructor.- Parameters:
surf
- surface on which grid lines will be specified
-
-
Method Details
-
getDefaultRadius
public double getDefaultRadius()Returns a reasonable radius for the sphere if none is explicitly specified. The general idea is to have something that will be visible. If the data origin is within the visible region, then the largest sphere that will fit is used, otherwise it's a sphere for which at least part of the surface appears in the visible region.- Returns:
- reasonable radius for sphere in data units
-
getLongitudeLines
Returns an array of line specifications representing lines of longitude.- Parameters:
dRadius
- radius in data unitsnLon
- number of equally spaced great circles required; note this is half the number of meridians- Returns:
nLon
-element array of meridian specifiers
-
getLatitudeLines
Returns an array of line specifications representing lines of latitude.- Parameters:
dRadius
- radius in data unitsnLat
- number of equally spaced latitude lines in the north (or south) hemisphere; excludes the equator- Returns:
1+nLat*2
-element aray of parallel specifiers
-