本文整理汇总了Java中gov.nasa.worldwind.geom.Angle类的典型用法代码示例。如果您正苦于以下问题:Java Angle类的具体用法?Java Angle怎么用?Java Angle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Angle类属于gov.nasa.worldwind.geom包,在下文中一共展示了Angle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterShow
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
/**
* @see org.leo.traceroute.ui.AbstractRoutePanel#afterShow()
*/
@Override
public void afterShow(final Mode mode) {
super.afterShow(mode);
SwingUtilities.invokeLater(() -> {
_container.invalidate();
_container.revalidate();
final GeoPoint localGeo = _services.getGeo().getLocalIpGeoLocation();
final Position p = new Position(Angle.fromDegrees(localGeo.getLat()), Angle.fromDegrees(localGeo.getLon()), 2000);
((OrbitView) _controller.getWWd().getView()).setCenterPosition(p);
if (mode == Mode.TRACE_ROUTE) {
_route.renotifyRoute();
} else if (mode == Mode.SNIFFER) {
_sniffer.renotifyPackets();
} else {
_whois.renotifyWhoIs();
}
});
}
示例2: LocRecord
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
public LocRecord(final String owner, final double lat, final double lon) {
this.owner = owner;
final StringBuilder sb = new StringBuilder();
//owner TTL class LOC ( d1 [m1 [s1]] {"N"|"S"} d2 [m2 [s2]] {"E"|"W"} alt["m"] [siz["m"] [hp["m"] [vp["m"]]]] )
final double[] latDms = Angle.fromDegreesLatitude(lat).toDMS();
final double[] lonDms = Angle.fromDegreesLatitude(lon).toDMS();
sb.append(owner).append(".").append(SPACE).append(0).append(SPACE).append("IN").append(SPACE).append("LOC").append(SPACE);
sb.append(Math.abs((int) latDms[0])).append(SPACE).append((int) latDms[1]).append(SPACE).append((float) latDms[2]).append(SPACE).append(lat >= 0 ? "N" : "S")
.append(SPACE);
sb.append(Math.abs((int) lonDms[0])).append(SPACE).append((int) lonDms[1]).append(SPACE).append((float) lonDms[2]).append(SPACE).append(lon >= 0 ? "E" : "W")
.append(SPACE);
sb.append("0m").append(SPACE).append("0m").append(SPACE).append("0m").append(SPACE).append("0m");
raw = sb.toString();
location = new Location();
location.countryCode = LOC;
location.countryName = "Loc record";
location.latitude = (float) lat;
location.longitude = (float) lon;
valid = true;
}
示例3: doZoom
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
public void doZoom(Point2D p, double factor) {
LatLon dest = new LatLon(Angle.fromDegrees(p.getY()), Angle.fromDegrees(p.getX()));
double wwzoom = 2785 * Math.pow(factor, -.8311) * 10000;
final OrbitView view = (OrbitView) wwd.getView();
FlyToOrbitViewAnimator fto =
FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
view,
view.getCenterPosition(), new Position(dest, 0),
view.getHeading(), Angle.fromDegrees(0),
view.getPitch(), Angle.fromDegrees(0),
view.getZoom(), wwzoom,
5000, WorldWind.CONSTANT); //was true
view.addAnimator(fto);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
((MapApp)getApp()).getFrame().toFront();
view.firePropertyChange(AVKey.VIEW, null, view);
}
});
}
示例4: makeLevels
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels) {
AVList params = new AVListImpl();
params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
params.setValue(AVKey.DATA_CACHE_NAME, "scs_tracks");
params.setValue(AVKey.SERVICE, "null");
params.setValue(AVKey.DATASET_NAME, "scs_tracks");
params.setValue(AVKey.FORMAT_SUFFIX, "null");
params.setValue(AVKey.NUM_LEVELS, numLevels);
params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
return new LevelSet(params);
}
示例5: makeLevels
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels, String name) {
AVList params = new AVListImpl();
params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
params.setValue(AVKey.DATA_CACHE_NAME, "mgg_" + name);
params.setValue(AVKey.SERVICE, "null");
params.setValue(AVKey.DATASET_NAME, "mgg_" + name);
params.setValue(AVKey.FORMAT_SUFFIX, "null");
params.setValue(AVKey.NUM_LEVELS, numLevels);
params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
return new LevelSet(params);
}
示例6: makeLevels
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels) {
AVList params = new AVListImpl();
params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
params.setValue(AVKey.DATA_CACHE_NAME, "mb_tracks");
params.setValue(AVKey.SERVICE, "null");
params.setValue(AVKey.DATASET_NAME, "mb_tracks");
params.setValue(AVKey.FORMAT_SUFFIX, "null");
params.setValue(AVKey.NUM_LEVELS, numLevels);
params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
return new LevelSet(params);
}
示例7: makeLevels
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
private static LevelSet makeLevels(int numLevels) {
AVList params = new AVListImpl();
params.setValue(AVKey.TILE_WIDTH, TILE_SIZE);
params.setValue(AVKey.TILE_HEIGHT, TILE_SIZE);
params.setValue(AVKey.DATA_CACHE_NAME, "null");
params.setValue(AVKey.SERVICE, "null");
params.setValue(AVKey.DATASET_NAME, "grid");
params.setValue(AVKey.FORMAT_SUFFIX, "null");
params.setValue(AVKey.NUM_LEVELS, numLevels);
params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(Angle.fromDegrees(36), Angle.fromDegrees(36)));
params.setValue(AVKey.SECTOR, Sector.FULL_SPHERE);
return new LevelSet(params);
}
示例8: setFallbacks
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
protected static void setFallbacks(AVList params)
{
if (params.getValue(AVKey.LEVEL_ZERO_TILE_DELTA) == null)
{
Angle delta = Angle.fromDegrees(36);
params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(delta, delta));
}
if (params.getValue(AVKey.TILE_WIDTH) == null)
params.setValue(AVKey.TILE_WIDTH, 512);
if (params.getValue(AVKey.TILE_HEIGHT) == null)
params.setValue(AVKey.TILE_HEIGHT, 512);
if (params.getValue(AVKey.FORMAT_SUFFIX) == null)
params.setValue(AVKey.FORMAT_SUFFIX, ".dds");
if (params.getValue(AVKey.NUM_LEVELS) == null)
params.setValue(AVKey.NUM_LEVELS, 19); // approximately 0.1 meters per pixel
if (params.getValue(AVKey.NUM_EMPTY_LEVELS) == null)
params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
}
示例9: fromLatLon
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
/**
* Create a set of UPS coordinates from a pair of latitude and longitude for the given <code>Globe</code>.
*
* @param latitude the latitude <code>Angle</code>.
* @param longitude the longitude <code>Angle</code>.
* @param globe the <code>Globe</code> - can be null (will use WGS84).
*
* @return the corresponding <code>UPSCoord</code>.
*
* @throws IllegalArgumentException if <code>latitude</code> or <code>longitude</code> is null, or the conversion to
* UPS coordinates fails.
*/
public static UPSCoord fromLatLon(Angle latitude, Angle longitude)
{
if (latitude == null || longitude == null)
{
throw new IllegalArgumentException("Latitude Or Longitude Is Null");
}
final UPSCoordConverter converter = new UPSCoordConverter();
long err = converter.convertGeodeticToUPS(latitude.radians, longitude.radians);
if (err != UPSCoordConverter.UPS_NO_ERROR)
{
throw new IllegalArgumentException("UPS Conversion Error");
}
return new UPSCoord(latitude, longitude, converter.getHemisphere(),
converter.getEasting(), converter.getNorthing());
}
示例10: fromLatLon
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
/**
* Create a MGRS coordinate from a pair of latitude and longitude <code>Angle</code>
* with the given precision or number of digits (1 to 5).
*
* @param latitude the latitude <code>Angle</code>.
* @param longitude the longitude <code>Angle</code>.
* @param globe the <code>Globe</code> - can be null (will use WGS84).
* @param precision the number of digits used for easting and northing (1 to 5).
* @return the corresponding <code>MGRSCoord</code>.
* @throws IllegalArgumentException if <code>latitude</code> or <code>longitude</code> is null,
* or the conversion to MGRS coordinates fails.
*/
public static MGRSCoord fromLatLon(Angle latitude, Angle longitude, int precision)
{
if (latitude == null || longitude == null)
{
throw new IllegalArgumentException("Latitude Or Longitude Is Null");
}
final MGRSCoordConverter converter = new MGRSCoordConverter();
long err = converter.convertGeodeticToMGRS(latitude.radians, longitude.radians, precision);
if (err != MGRSCoordConverter.MGRS_NO_ERROR)
{
throw new IllegalArgumentException("MGRS Conversion Error");
}
return new MGRSCoord(latitude, longitude, converter.getMGRSString());
}
示例11: fromString
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
/**
* Create a MGRS coordinate from a standard MGRS coordinate text string.
* <p>
* The string will be converted to uppercase and stripped of all spaces before being evaluated.
* </p>
* <p>Valid examples:<br />
* 32TLP5626635418<br />
* 32 T LP 56266 35418<br />
* 11S KU 528 111<br />
* </p>
* @param MGRSString the MGRS coordinate text string.
* @param globe the <code>Globe</code> - can be null (will use WGS84).
* @return the corresponding <code>MGRSCoord</code>.
* @throws IllegalArgumentException if the <code>MGRSString</code> is null or empty,
* the <code>globe</code> is null, or the conversion to geodetic coordinates fails (invalid coordinate string).
*/
public static MGRSCoord fromString(String MGRSString)
{
if (MGRSString == null || MGRSString.length() == 0)
{
throw new IllegalArgumentException("String Is Null");
}
MGRSString = MGRSString.toUpperCase().replaceAll(" ", "");
final MGRSCoordConverter converter = new MGRSCoordConverter();
long err = converter.convertMGRSToGeodetic(MGRSString);
if (err != MGRSCoordConverter.MGRS_NO_ERROR)
{
throw new IllegalArgumentException("MGRS Conversion Error (\"" +
MGRSString +"\")");
}
return new MGRSCoord(Angle.fromRadians(converter.getLatitude()), Angle.fromRadians(converter.getLongitude()), MGRSString);
}
示例12: MGRSCoord
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
/**
* Create an arbitrary MGRS coordinate from a pair of latitude-longitude <code>Angle</code>
* and the corresponding MGRS coordinate string.
*
* @param latitude the latitude <code>Angle</code>.
* @param longitude the longitude <code>Angle</code>.
* @param MGRSString the corresponding MGRS coordinate string.
* @throws IllegalArgumentException if <code>latitude</code> or <code>longitude</code> is null,
* or the MGRSString is null or empty.
*/
public MGRSCoord(Angle latitude, Angle longitude, String MGRSString)
{
if (latitude == null || longitude == null)
{
throw new IllegalArgumentException("Latitude Or Longitude Is Null");
}
if (MGRSString == null)
{
throw new IllegalArgumentException("String Is Null");
}
if (MGRSString.length() == 0)
{
throw new IllegalArgumentException("String Is Empty");
}
this.latitude = latitude;
this.longitude = longitude;
this.MGRSString = MGRSString;
}
示例13: TMCoord
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
/**
* Create an arbitrary set of Transverse Mercator coordinates with the given values.
*
* @param latitude the latitude <code>Angle</code>.
* @param longitude the longitude <code>Angle</code>.
* @param easting the easting distance value in meters.
* @param northing the northing distance value in meters.
* @param originLatitude the origin latitude <code>Angle</code>.
* @param centralMeridian the central meridian longitude <code>Angle</code>.
* @param falseEasting easting value at the center of the projection in meters.
* @param falseNorthing northing value at the center of the projection in meters.
* @param scale scaling factor.
* @throws IllegalArgumentException if <code>latitude</code>, <code>longitude</code>, <code>originLatitude</code>
* or <code>centralMeridian</code> is null.
*/
public TMCoord(Angle latitude, Angle longitude, double easting, double northing,
Angle originLatitude, Angle centralMeridian,
double falseEasting, double falseNorthing,
double scale)
{
if (latitude == null || longitude == null)
{
throw new IllegalArgumentException("Latitude Or Longitude Is Null");
}
if (originLatitude == null || centralMeridian == null)
{
throw new IllegalArgumentException("Angle Is Null");
}
this.latitude = latitude;
this.longitude = longitude;
this.easting = easting;
this.northing = northing;
this.originLatitude = originLatitude;
this.centralMeridian = centralMeridian;
this.falseEasting = falseEasting;
this.falseNorthing = falseNorthing;
this.scale = scale;
}
示例14: parseCoordinates
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
private PointOfInterest parseCoordinates(String coords[])
{
if (isDecimalDegrees(coords))
{
Double d1 = Double.parseDouble(coords[0].trim());
Double d2 = Double.parseDouble(coords[1].trim());
return new BasicPointOfInterest(LatLon.fromDegrees(d1, d2));
}
else //may be in DMS
{
Angle aLat = Angle.fromDMS(coords[0].trim());
Angle aLon = Angle.fromDMS(coords[1].trim());
return new BasicPointOfInterest(LatLon.fromDegrees(aLat.getDegrees(), aLon.getDegrees()));
}
}
示例15: setAnnotationPosition
import gov.nasa.worldwind.geom.Angle; //导入依赖的package包/类
private void setAnnotationPosition( final TrackPointAnnotation sliderAnnotation,
final TourData tourData,
final int positionIndex) {
final double[] latitudeSerie = tourData.latitudeSerie;
final double[] longitudeSerie = tourData.longitudeSerie;
final double latitude = latitudeSerie[positionIndex];
final double longitude = longitudeSerie[positionIndex];
final float[] altitudeSerie = tourData.altitudeSerie;
final float trackAltitude = altitudeSerie == null ? 0 : altitudeSerie[positionIndex];
final TourTrackConfig config = TourTrackConfigManager.getActiveConfig();
final LatLon latLon = new LatLon(//
Angle.fromDegrees(latitude),
Angle.fromDegrees(longitude));
sliderAnnotation.latLon = latLon;
sliderAnnotation.trackAltitude = trackAltitude;
sliderAnnotation.setAltitudeMode(config.altitudeMode);
}