1 9 package org.jscience.physics.quantities; 10 import org.jscience.physics.units.SI; 11 import org.jscience.physics.units.Unit; 12 13 21 public class Area extends Quantity { 22 23 26 private final static Unit<Area> UNIT = SI.SQUARE_METER; 27 28 31 private final static Factory<Area> FACTORY = new Factory<Area>( 32 UNIT) { 33 protected Area create() { 34 return new Area(); 35 } 36 }; 37 38 41 public final static Area ZERO = Quantity.valueOf(0, UNIT); 42 43 46 protected Area() { 47 } 48 49 54 public static void showAs(Unit unit) { 55 QuantityFormat.show(Area.class, unit); 56 } 57 58 62 69 public static Area valueOf(Length radius, Angle theta) { 70 return theta.times(radius.times(radius)).times(0.5).to(UNIT); 72 } 73 74 private static final long serialVersionUID = 1L; 75 76 } 77 | Popular Tags |