• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Angle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.measure.quantity.Angle的典型用法代码示例。如果您正苦于以下问题:Java Angle类的具体用法?Java Angle怎么用?Java Angle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Angle类属于javax.measure.quantity包,在下文中一共展示了Angle类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: valueOf

import javax.measure.quantity.Angle; //导入依赖的package包/类
/**
 * Returns the surface position corresponding to the specified coordinates.
 * 
 * @param latitude the latitude value stated in the specified unit.
 * @param longitude the longitude value stated in the specified unit.
 * @param unit the angle unit in which the coordinates are stated
 *        ({@link javax.measure.unit.NonSI#DEGREE_ANGLE Degree} typically).
 * @return the corresponding surface position.
 */
public static LatLong valueOf(double latitude, double longitude,
        Unit<Angle> unit) {
    LatLong latLong = FACTORY.object();
    if (unit == DEGREE_ANGLE) {
        latLong._latitude = latitude;
        latLong._longitude = longitude;
    } else if (unit == RADIAN) {
        latLong._latitude = RADIAN_TO_DEGREE.convert(latitude);
        latLong._longitude = RADIAN_TO_DEGREE.convert(longitude);
    } else { // Other angle unit.
        UnitConverter toDegree = unit.getConverterTo(DEGREE_ANGLE);
        latLong._latitude = toDegree.convert(latitude);
        latLong._longitude = toDegree.convert(longitude);
    }
    return latLong;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:26,代码来源:LatLong.java


示例2: CompositeTrackWrapper

import javax.measure.quantity.Angle; //导入依赖的package包/类
public CompositeTrackWrapper(IStoreGroup track, String name)
{
  _name = name;

  // assign the components
  _course =
      aTests.findCollectionWith(track, Angle.UNIT.getDimension(), false);
  _speed =
      aTests.findCollectionWith(track, Velocity.UNIT.getDimension(),
          false);

  Iterator<IStoreItem> iter = track.iterator();
  while (iter.hasNext())
  {
    IStoreItem iStoreItem = (IStoreItem) iter.next();
    if (iStoreItem instanceof LocationDocument)
    {
      _location = (LocationDocument) iStoreItem;
    }
  }
}
 
开发者ID:debrief,项目名称:limpet,代码行数:22,代码来源:DopplerShiftBetweenTracksOperation.java


示例3: getCreate

import javax.measure.quantity.Angle; //导入依赖的package包/类
private static List<IOperation> getCreate()
{
  List<IOperation> create = new ArrayList<IOperation>();

  create.add(new AddLayerOperation());

  create
      .add(new CreateSingletonGenerator("dimensionless", Dimensionless.UNIT));

  create.add(new CreateSingletonGenerator("frequency", HERTZ
      .asType(Frequency.class)));

  create.add(new CreateSingletonGenerator("decibels", NonSI.DECIBEL));

  create.add(new CreateSingletonGenerator("speed (m/s)", METRE.divide(SECOND)
      .asType(Velocity.class)));

  create.add(new CreateSingletonGenerator("course (degs)",
      SampleData.DEGREE_ANGLE.asType(Angle.class)));
  create.add(new CreateSingletonGenerator("time (secs)",
      SI.SECOND.asType(Duration.class)));
  // create.add(new CreateLocationAction());
  create.add(new GenerateGrid());

  return create;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:27,代码来源:OperationsLibrary.java


示例4: main

import javax.measure.quantity.Angle; //导入依赖的package包/类
public static void main(String[] args) {
Unit<Mass> atomicMassUnit = UNIFIED_ATOMIC_MASS;
System.out.println(atomicMassUnit + " (" + atomicMassUnit.getName() + "; " + atomicMassUnit.getSymbol() + ")");

AbstractQuantity<Mass> mass = NumberQuantity.of(10, atomicMassUnit);
System.out.println(mass);

Quantity<Mass> massInKg = mass.to(KILOGRAM);
System.out.println(massInKg);

System.out.println(WATT_PER_STERADIAN);
System.out.println(WATT_PER_STERADIAN_PER_SQUARE_METRE);

Quantity<Angle> angle = Quantities.getQuantity(Math.PI, SI.RADIAN);
System.out.println(angle.to(NonSI.DEGREE_ANGLE));
   }
 
开发者ID:unitsofmeasurement,项目名称:uom-demos,代码行数:17,代码来源:SIDemo.java


示例5: testNonTimeIndex

import javax.measure.quantity.Angle; //导入依赖的package包/类
@Test
public void testNonTimeIndex() throws Exception
{
  File file = getDataFile("non_time/BalloonAscentData.csv");
  assertTrue(file.isFile());
  final String absPath = file.getAbsolutePath();
  List<IStoreItem> items = new CsvParser().parse(absPath);
  assertEquals("correct group", 1, items.size());
  StoreGroup group = (StoreGroup) items.get(0);
  assertEquals("correct num collections", 9, group.size());
  IDocument<?> firstColl = (IDocument<?>) group.get(0);
  assertEquals("correct num rows", 185, firstColl.size());

  // check we have the correct data types
  int ctr = 0;
  NumberDocument thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units", SECOND, thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Time", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units",MILLI(BAR).asType(
      Pressure.class), thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Pressure", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units",CELSIUS, thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Air Temperature", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units",CELSIUS, thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Dewpoint", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units",GRAM
      .divide(CENTI(METER).pow(3)).asType(VolumetricDensity.class), thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Water density", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units",Dimensionless.UNIT, thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Humidity", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units",METRE.divide(SECOND).asType(
      Velocity.class), thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Wind speed", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  thisN = (NumberDocument) group.get(ctr++);
  assertTrue("correct data type", thisN instanceof NumberDocument);
  assertEquals("correct units",SampleData.DEGREE_ANGLE
      .asType(Angle.class), thisN.getUnits());
  assertEquals("correct name", "BalloonAscentData-Wind direction", thisN.getName());
  assertEquals("correct index units", METER, thisN.getIndexUnits());

  StringDocument thisS = (StringDocument) group.get(8);
  assertTrue("correct data type", thisS instanceof StringDocument);
  assertEquals("correct index units", METER, thisS.getIndexUnits());
}
 
开发者ID:debrief,项目名称:limpet,代码行数:72,代码来源:TestCsvParser.java


示例6: getCourseAt

import javax.measure.quantity.Angle; //导入依赖的package包/类
@Override
public double getCourseAt(long time)
{
  return aTests.valueAt(_course, time, RADIAN.asType(Angle.class));
}
 
开发者ID:debrief,项目名称:limpet,代码行数:6,代码来源:DopplerShiftBetweenTracksOperation.java


示例7: createImporters

import javax.measure.quantity.Angle; //导入依赖的package包/类
private void createImporters()
{
  if (_candidates != null)
  {
    return;
  }

  _candidates = new ArrayList<DataImporter>();
  _candidates.add(new AbsoluteLocationImporter());
  _candidates.add(new RelativeLocationImporter());
  _candidates.add(new TemporalSeriesSupporter(SECOND.asType(Duration.class),
      null, new String[]
      {"secs", "s"}));
  _candidates.add(new TemporalSeriesSupporter(MILLI(SECOND).asType(
      Duration.class), null, "ms"));
  _candidates.add(new TemporalSeriesSupporter(HERTZ.asType(Frequency.class),
      null, "Hz"));
  _candidates.add(new TemporalSeriesSupporter(SampleData.DEGREE_ANGLE.divide(
      SECOND).asType(AngularVelocity.class), null, "Degs/sec"));
  _candidates.add(new TemporalSeriesSupporter(METRE.asType(Length.class),
      null, "m"));
  _candidates.add(new TemporalSeriesSupporter(MILLI(BAR).asType(
      Pressure.class), null, new String[]
  {"mb", "millibars"}));
  _candidates.add(new TemporalSeriesSupporter(YARD.asType(Length.class),
      null, "yds"));
  _candidates.add(new TemporalSeriesSupporter(SampleData.DEGREE_ANGLE
      .asType(Angle.class), null, new String[]
  {"Degs", "Degr", "Deg"}));
  _candidates.add(new TemporalSeriesSupporter(GRAM
      .divide(CENTI(METER).pow(3)).asType(VolumetricDensity.class), null,
      new String[]
      {"g/cm3", "g/cm"}));
  _candidates.add(new TemporalSeriesSupporter(NAUTICAL_MILE.divide(
      SECOND.times(3600)).asType(Velocity.class), null, "kts"));
  _candidates.add(new TemporalSeriesSupporter(NonSI.MILE.divide(
      SI.SECOND.times(60 * 60)).asType(Velocity.class), null, new String[]
  {"mph"}));
  _candidates.add(new TemporalSeriesSupporter(NonSI.REVOLUTION.divide(SECOND
      .times(60)), null, new String[]
  {"rpm"}));
  _candidates.add(new TemporalSeriesSupporter(METRE.divide(SECOND).asType(
      Velocity.class), null, new String[]
  {"M/Sec", "m/s"}));
  _candidates.add(new TemporalSeriesSupporter(SI.CELSIUS
      .asType(Temperature.class), null, new String[]
  {"C", "DegC"}));
  _candidates.add(new TemporalSeriesSupporter(DECIBEL
      .asType(Dimensionless.class), null, new String[]
  {"dB"}));
}
 
开发者ID:debrief,项目名称:limpet,代码行数:52,代码来源:CsvParser.java


示例8: getWindDirection

import javax.measure.quantity.Angle; //导入依赖的package包/类
public Measurable<Angle> getWindDirection() {
    return windDirection;
}
 
开发者ID:kalixia,项目名称:kha,代码行数:4,代码来源:WeatherConditions.java


示例9: setWindDirection

import javax.measure.quantity.Angle; //导入依赖的package包/类
public void setWindDirection(Measurable<Angle> windDirection) {
    this.windDirection = windDirection;
}
 
开发者ID:kalixia,项目名称:kha,代码行数:4,代码来源:WeatherConditions.java


示例10: getRingTwoRot

import javax.measure.quantity.Angle; //导入依赖的package包/类
public Amount<Angle> getRingTwoRot() {
	return ringTwoRot;
}
 
开发者ID:bkuker,项目名称:motorsim,代码行数:4,代码来源:MultiPort.java


示例11: setRingTwoRot

import javax.measure.quantity.Angle; //导入依赖的package包/类
public void setRingTwoRot(Amount<Angle> ringTwoRot) {
	this.ringTwoRot = ringTwoRot;
	generateGeometry();
}
 
开发者ID:bkuker,项目名称:motorsim,代码行数:5,代码来源:MultiPort.java


示例12: latitudeValue

import javax.measure.quantity.Angle; //导入依赖的package包/类
/**
 * Returns the latitude value as <code>double</code>
 * 
 * @param unit the angle unit of the latitude to return.
 * @return the latitude stated in the specified unit.
 */
public final double latitudeValue(Unit<Angle> unit) {
    return (unit == DEGREE_ANGLE) ? _latitude
            : (unit == RADIAN) ? DEGREE_TO_RADIAN.convert(_latitude)
                    : DEGREE_ANGLE.getConverterTo(unit).convert(_latitude);
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:12,代码来源:LatLong.java


示例13: longitudeValue

import javax.measure.quantity.Angle; //导入依赖的package包/类
/**
 * Returns the longitude value as <code>double</code>
 * 
 * @param unit the angle unit of the longitude to return.
 * @return the longitude stated in the specified unit.
 */
public final double longitudeValue(Unit<Angle> unit) {
    return (unit == DEGREE_ANGLE) ? _longitude
            : (unit == RADIAN) ? DEGREE_TO_RADIAN.convert(_longitude)
                    : DEGREE_ANGLE.getConverterTo(unit).convert(_longitude);
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:12,代码来源:LatLong.java



注:本文中的javax.measure.quantity.Angle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GMLWriter类代码示例发布时间:2022-05-22
下一篇:
Java Multiplicity类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap