public static class Target.Builder
extends java.lang.Object
To use the builder, instantiate it with the target body and coordinates,
optionally set a label and/or comment, and invoke the build()
method. For example, to create a new target site in the center of Aram
Chaos (on Mars), use the following code:
Target aramChaos = new Target.Builder ( Body.getInstance (499), Math.toRadians (338.5), Math.toRadians (2.57), -4.5 ).label ("Aram Chaos").comment ("The center of Aram Chaos.").build ();
499 is the NAIF body ID code for Mars.
Coordinates are planetocentric, east-leading and are in radians. Altitude is in kilometers.
Constructor and Description |
---|
Builder(Body body,
double longitude,
double latitude,
double altitude)
Creates a new target builder with the indicated body and coordinates.
|
Modifier and Type | Method and Description |
---|---|
Target |
build()
Instantiates a new, immutable target site from this builder.
|
Target.Builder |
comment(java.lang.String comment)
Sets the optional target comment for this target builder.
|
Target.Builder |
label(java.lang.String label)
Sets the optional target label for this target builder.
|
Target.Builder |
usingDegrees()
Sets the builder to interpret its longitude and latitude as degrees instead
of radians.
|
Target.Builder |
usingPlanetographicLatitude()
Sets the builder to interpret its latitude as a planetographic latitude
instead of planetocentric.
|
public Builder(Body body, double longitude, double latitude, double altitude)
Note that the angles are presumed to be in radians and that the latitude is
presumed to be planetocentric. Use the usingDegrees()
and/or the
usingPlanetographicLatitude()
methods prior to invoking the build()
method if necessary.
body
- the target body.longitude
- the east-leading longitude of the target site in radians.latitude
- the planetocentric latitude of the target site in
radians.altitude
- the altitude in km of the target site above the
reference ellipsoid.public Target.Builder label(java.lang.String label)
label
- the target site's optional label.public Target.Builder comment(java.lang.String comment)
comment
- the target site's optional comment.public Target.Builder usingDegrees()
public Target.Builder usingPlanetographicLatitude()
public Target build()
The builder's longitude and latitude are presumed to be radians, and the
latitude is further presumed to be planetocentric. Use the usingDegrees()
and/or the usingPlanetographicLatitude()
methods
if necessary prior to invoking this method.
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona