KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jscience > physics > units > NonSI


1 /*
2  * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
3  * Copyright (C) 2005 - JScience (http://jscience.org/)
4  * All rights reserved.
5  *
6  * Permission to use, copy, modify, and distribute this software is
7  * freely granted, provided that this notice is preserved.
8  */

9 package org.jscience.physics.units;
10
11 import org.jscience.physics.quantities.*;
12 import static org.jscience.physics.units.SI.*;
13 import static javolution.lang.MathLib.*;
14
15 /**
16  * <p> This class contains units that are not part of the International
17  * System of Units, that is, they are outside the SI, but are important
18  * and widely used.</p>
19  *
20  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
21  * @version 2.0, June 16, 2004
22  */

23 public final class NonSI {
24
25     /**
26      * Holds the standard gravity constant.
27      */

28     private static double STANDARD_GRAVITY = 9.80665; // (m/s²) exact.
29

30     /**
31      * Holds the international foot.
32      */

33     private static double INTERNATIONAL_FOOT = 0.3048; // (m) exact.
34

35     /**
36      * Holds the avoirdupois pound.
37      */

38     private static double AVOIRDUPOIS_POUND = 0.45359237; // (kg) exact.
39

40     /**
41      * Holds the Avogadro constant.
42      */

43     private static double AVOGADRO_CONSTANT = 6.02214199e23; // (1/mol).
44

45     /**
46      * Holds the electric charge of one electron.
47      */

48     private static double ELEMENTARY_CHARGE = 1.602176462e-19; // (C).
49

50     /**
51      * Default constructor (prevents this class from being instantiated).
52      */

53     private NonSI() {
54     }
55
56     ///////////////////
57
// Dimensionless //
58
///////////////////
59

60     /**
61      * A dimensionless unit equals to <code>0.01</code>
62      * (default label <code>%</code>).
63      */

64     public static final Unit<Dimensionless> PERCENT = Unit.ONE.times(0.01)
65             .label("%");
66
67     /**
68      * A logarithmic unit used to describe a ratio
69      * (default label <code>dB</code>).
70      */

71     public static final Unit<Dimensionless> DECIBEL = Unit.ONE.transform(
72             new LogConverter(10).inverse().concatenate(
73                     new MultiplyConverter(0.1))).label("dB");
74
75     //////////////////
76
// Acceleration //
77
//////////////////
78

79     /**
80      * A unit of acceleration equal to an acceleration of one centimeter per
81      * second per second.
82      */

83     public static final Unit<Acceleration> GALILEO = METER_PER_SQUARE_SECOND
84             .times(1e-2);
85
86     /**
87      * A unit of acceleration equal to the gravity at the earth's surface
88      * (default label <code>grav</code>).
89      */

90     public static final Unit<Acceleration> G = METER_PER_SQUARE_SECOND.times(
91             STANDARD_GRAVITY).label("grav");
92
93     /////////////////////////
94
// Amount of substance //
95
/////////////////////////
96

97     /**
98      * A unit of amount of substance equals to one atom
99      * (default label <code>atom</code>).
100      */

101     public static final Unit<AmountOfSubstance> ATOM = MOLE.times(
102             1.0 / AVOGADRO_CONSTANT).label("atom");
103
104     ///////////
105
// Angle //
106
///////////
107

108     /**
109      * A unit of angle equal to a full circle or <code>2<i>&pi;</i>
110      * {@link SI#RADIAN}</code> (default label <code>rev</code>).
111      */

112     public static final Unit<Angle> REVOLUTION = RADIAN.times(2.0 * PI).label(
113             "rev");
114
115     /**
116      * A unit of angle equal to <code>1/360 {@link #REVOLUTION}</code>
117      * (default label <code>°</code>).
118      */

119     public static final Unit<Angle> DEGREE_ANGLE = REVOLUTION
120             .times(1.0 / 360.0).label("°");
121
122     /**
123      * A unit of angle equal to <code>1/60 {@link #DEGREE_ANGLE}</code>
124      * (default label <code>′</code>).
125      */

126     public static final Unit<Angle> MINUTE_ANGLE = DEGREE_ANGLE.times(
127             1.0 / 60.0).label("′");
128
129     /**
130      * A unit of angle equal to <code>1/60 {@link #MINUTE_ANGLE}</code>
131      * (default label <code>"</code>).
132      */

133     public static final Unit<Angle> SECOND_ANGLE = MINUTE_ANGLE.times(
134             1.0 / 60.0).label("″");
135
136     /**
137      * A unit of angle equal to <code>0.01 {@link SI#RADIAN}</code>
138      * (default label <code>centiradian</code>).
139      */

140     public static final Unit<Angle> CENTIRADIAN = RADIAN.times(0.01).label(
141             "centiradian");
142
143     /**
144      * A unit of angle measure equal to <code>1/400 {@link #REVOLUTION}</code>
145      * (default label <code>grade</code>).
146      */

147     public static final Unit<Angle> GRADE = REVOLUTION.times(1.0 / 400.0)
148             .label("grade");
149
150     //////////
151
// Area //
152
//////////
153

154     /**
155      * A unit of area equal to <code>100 m²</code>
156      * (default label <code>a</code>).
157      */

158     public static final Unit<Area> ARE = SQUARE_METER.times(100).label("a"); // Exact.
159

160     /**
161      * A unit of area equal to <code>100 {@link #ARE}</code>
162      * (default label <code>ha</code>).
163      */

164     public static final Unit<Area> HECTARE = ARE.times(100).label("ha"); // Exact.
165

166     /**
167      * A unit of area equal to <code>100 fm²</code>
168      * (default label <code>b</code>).
169      */

170     public static final Unit<Area> BARN = SQUARE_METER.times(1e-28).label("b"); // Exact.
171

172     /////////////////
173
// Data Amount //
174
/////////////////
175

176     /**
177      * A unit of data amount equal to <code>8 {@link SI#BIT}</code>
178      * (BinarY TErm, default label <code>byte</code>).
179      */

180     public static final Unit<DataAmount> BYTE = BIT.times(8).label("byte");
181
182     /**
183      * Equivalent {@link #BYTE}
184      */

185     public static final Unit<DataAmount> OCTET = BYTE;
186
187     //////////////
188
// Duration //
189
//////////////
190

191     /**
192      * A unit of duration equal to <code>60 s</code>
193      * (default label <code>min</code>).
194      */

195     public static final Unit<Duration> MINUTE = SI.SECOND.times(60)
196             .label("min");
197
198     /**
199      * A unit of duration equal to <code>60 {@link #MINUTE}</code>
200      * (default label <code>h</code>).
201      */

202     public static final Unit<Duration> HOUR = MINUTE.times(60).label("h");
203
204     /**
205      * A unit of duration equal to <code>24 {@link #HOUR}</code>
206      * (default label <code>d</code>).
207      */

208     public static final Unit<Duration> DAY = HOUR.times(24).label("day");
209
210     /**
211      * A unit of duration equal to <code>7 {@link #DAY}</code>
212      * (default label <code>week</code>).
213      */

214     public static final Unit<Duration> WEEK = DAY.times(7).label("week");
215
216     /**
217      * A unit of duration equal to 365 days, 5 hours, 49 minutes,
218      * and 12 seconds (default label <code>year</code>).
219      */

220     public static final Unit<Duration> YEAR = SECOND.times(31556952).label(
221             "year");
222
223     /**
224      * A unit of duration equal to one twelfth of a year
225      * (default label <code>month</code>).
226      */

227     public static final Unit<Duration> MONTH = YEAR.times(1.0 / 12.0).label(
228             "month");
229
230     /**
231      * A unit of duration equal to the time required for a complete rotation of
232      * the earth in reference to any star or to the vernal equinox at the
233      * meridian, equal to 23 hours, 56 minutes, 4.09 seconds
234      * (default label <code>day_sidereal</code>).
235      */

236     public static final Unit<Duration> DAY_SIDEREAL = SECOND.times(86164.09)
237             .label("day_sidereal");
238
239     /**
240      * A unit of duration equal to one complete revolution of the
241      * earth about the sun, relative to the fixed stars, or 365 days, 6 hours,
242      * 9 minutes, 9.54 seconds (default label <code>year_sidereal</code>).
243      */

244     public static final Unit<Duration> YEAR_SIDEREAL = SECOND
245             .times(31558149.54).label("year_sidereal");
246
247     /**
248      * A unit of duration equal to <code>365 {@link #DAY}</code>
249      * (default label <code>year_calendar</code>).
250      */

251     public static final Unit<Duration> YEAR_CALENDAR = DAY.times(365).label(
252             "year_calendar");
253
254     /**
255      * A unit of duration equal to <code>1E9 {@link #YEAR}</code>.
256      */

257     public static final Unit<Duration> AEON = YEAR.times(1e9);
258
259     /////////////////////
260
// Electric charge //
261
/////////////////////
262

263     /**
264      * A unit of electric charge equal to the charge on one electron
265      * (default label <code>e</code>).
266      */

267     public static final Unit<ElectricCharge> E = COULOMB.times(
268             ELEMENTARY_CHARGE).label("e");
269
270     /**
271      * A unit of electric charge equal to equal to the product of Avogadro's
272      * number (see {@link SI#MOLE}) and the charge (1 e) on a single electron
273      * (default label <code>Fd</code>).
274      */

275     public static final Unit<ElectricCharge> FARADAY = COULOMB.times(
276             ELEMENTARY_CHARGE * AVOGADRO_CONSTANT).label("Fd"); // e/mol
277

278     /**
279      * A unit of electric charge which exerts a force of one dyne on an equal
280      * charge at a distance of one centimeter
281      * (default label <code>Fr</code>).
282      */

283     public static final Unit<ElectricCharge> FRANKLIN = COULOMB.times(
284             3.3356e-10).label("Fr");
285
286     //////////////////////
287
// Electric current //
288
//////////////////////
289

290     /**
291      * A unit of electric charge equal to the centimeter-gram-second
292      * electromagnetic unit of magnetomotive force, equal to <code>10/4
293      * &pi;ampere-turn</code> (default label <code>Gi</code>).
294      */

295     public static final Unit<ElectricCurrent> GILBERT = SI.AMPERE.times(
296             10.0 / (4.0 * PI)).label("Gi");
297
298     ////////////
299
// Energy //
300
////////////
301

302     /**
303      * A unit of energy equal to <code>1055.056 J</code>
304      * (default label <code>Btu</code>).
305      */

306     public static final Unit<Energy> BTU = JOULE.times(1055.056).label("Btu");
307
308     /**
309      * A unit of energy equal to <code>1054.350 J</code>, thermochemical
310      * (default label <code>Btu_th</code>).
311      */

312     public static final Unit<Energy> BTU_TH = JOULE.times(1054.350).label(
313             "Btu_th");
314
315     /**
316      * A unit of energy equal to <code>1055.87 J</code>, mean
317      * (default label <code>Btu_mean</code>).
318      */

319     public static final Unit<Energy> BTU_MEAN = JOULE.times(1055.87).label(
320             "Btu_mean");
321
322     /**
323      * A unit of energy equal to <code>4.1868 J</code>
324      * (default label <code>cal</code>).
325      */

326     public static final Unit<Energy> CALORIE = JOULE.times(4.1868).label("cal");
327
328     /**
329      * A unit of energy equal to one kilo-calorie
330      * (default label <code>Cal</code>).
331      */

332     public static final Unit<Energy> KILOCALORIE = CALORIE.times(1e3).label(
333             "Cal");
334
335     /**
336      * A unit of energy equal to <code>1E-7 J</code>
337      * (default label <code>erg</code>).
338      */

339     public static final Unit<Energy> ERG = JOULE.times(1e-7).label("erg");
340
341     /**
342      * A unit of energy equal to one electron-volt (default label
343      * <code>eV</code>, also recognized <code>keV, MeV, GeV</code>).
344      */

345     public static final Unit<Energy> ELECTRON_VOLT = JOULE.times(
346             ELEMENTARY_CHARGE).label("eV");
347     static {
348         ELECTRON_VOLT.times(1e3).label("keV");
349         ELECTRON_VOLT.times(1e6).label("MeV");
350         ELECTRON_VOLT.times(1e9).label("GeV");
351     }
352
353     /**
354      * A unit of energy equal to <code>105.4804E6 J</code> (approximation,
355      * default label <code>thm</code>).
356      */

357     public static final Unit<Energy> THERM = JOULE.times(105.4804e6).label(
358             "thm"); // Appr.
359

360     /////////////////
361
// Illuminance //
362
/////////////////
363

364     /**
365      * A unit of illuminance equal to <code>1E4 Lx</code>
366      * (default label <code>La</code>).
367      */

368     public static final Unit<Illuminance> LAMBERT = LUX.times(1e4).label("La");
369
370     ////////////
371
// Length //
372
////////////
373

374     /**
375      * A unit of length equal to <code>0.3048 m</code>
376      * (default label <code>ft</code>).
377      */

378     public static final Unit<Length> FOOT = METER.times(INTERNATIONAL_FOOT)
379             .label("ft");
380
381     /**
382      * A unit of length equal to <code>1200/3937 m</code>
383      * (default label <code>foot_survey_us</code>).
384      * See also: <a HREF="http://www.sizes.com/units/foot.htm">foot</a>
385      */

386     public static final Unit<Length> FOOT_SURVEY_US = METER.times(
387             1200.0 / 3937.0).label("foot_survey_us");
388
389     /**
390      * A unit of length equal to <code>0.9144 m</code>
391      * (default label <code>yd</code>).
392      */

393     public static final Unit<Length> YARD = FOOT.times(3).label("yd");
394
395     /**
396      * A unit of length equal to <code>0.0254 m</code>
397      * (default label <code>in</code>).
398      */

399     public static final Unit<Length> INCH = FOOT.times(1.0 / 12.0).label("in");
400
401     /**
402      * A unit of length equal to <code>1609.344 m</code>
403      * (default label <code>mi</code>).
404      */

405     public static final Unit<Length> MILE = METER.times(1609.344).label("mi");
406
407     /**
408      * A unit of length equal to <code>1852.0 m</code>
409      * (default label <code>nmi</code>).
410      */

411     public static final Unit<Length> NAUTICAL_MILE = METER.times(1852.0).label(
412             "nmi");
413
414     /**
415      * A unit of length equal to <code>1E-10 m</code>
416      * (default label <code>Å</code>).
417      */

418     public static final Unit<Length> ANGSTROM = METER.times(1e-10).label("Å");
419
420     /**
421      * A unit of length equal to the average distance from the center of the
422      * Earth to the center of the Sun (default label <code>ua</code>).
423      */

424     public static final Unit<Length> ASTRONOMICAL_UNIT = METER.times(
425             149597870691.0).label("ua");
426
427     /**
428      * A unit of length equal to the distance that light travels in one year
429      * through a vacuum (default label <code>ly</code>).
430      */

431     public static final Unit<Length> LIGHT_YEAR = METER.times(9.460528405e15)
432             .label("ly");
433
434     /**
435      * A unit of length equal to the distance at which a star would appear to
436      * shift its position by one arcsecond over the course the time
437      * (about 3 months) in which the Earth moves a distance of
438      * {@link #ASTRONOMICAL_UNIT} in the direction perpendicular to the
439      * direction to the star (default label <code>pc</code>).
440      */

441     public static final Unit<Length> PARSEC = METER.times(30856770e9).label(
442             "pc");
443
444     /**
445      * A unit of length equal to the mean distance between the proton
446      * and the electron in an unexcited hydrogen atom
447      * (default label <code>Bohr</code>).
448      */

449     public static final Unit<Length> BOHR = METER.times(52.918e-12).label(
450             "Bohr");
451
452     /**
453      * A unit of length equal to <code>0.013837 {@link #INCH}</code> exactly
454      * (default label <code>pt</code>).
455      * @see #PIXEL
456      */

457     public static final Unit<Length> POINT = INCH.times(0.013837).label("pt");
458
459     /**
460      * A unit of length equal to <code>1/72 {@link #INCH}</code>
461      * (default label <code>pixel</code>).
462      * It is the American point rounded to an even 1/72 inch.
463      * @see #POINT
464      */

465     public static final Unit<Length> PIXEL = INCH.times(1.0 / 72.0).label(
466             "pixel");
467
468     /**
469      * Equivalent {@link #PIXEL}
470      */

471     public static final Unit<Length> COMPUTER_POINT = PIXEL;
472
473     /**
474      * A unit of length equal to <code>12 {@link #POINT}</code>
475      * (default label <code>pi</code>).
476      * @see #POINT
477      */

478     public static final Unit<Length> PICA = POINT.times(12).label("pi");
479
480     /**
481      * A unit of length equal to <code>0.37592e-3 m</code>
482      * (default label <code>Didot</code>).
483      */

484     public static final Unit<Length> DIDOT = METER.times(0.37592e-3).label(
485             "Didot");
486
487     /**
488      * A unit of length equal to <code>12 {@link #DIDOT}</code>
489      * (default label <code>cicero</code>).
490      */

491     public static final Unit<Length> CICERO = DIDOT.times(12).label("cicero");
492
493     ///////////////////
494
// Magnetic Flux //
495
///////////////////
496

497     /**
498      * A unit of magnetic flux equal <code>1E-8 Wb</code>
499      * (default label <code>Mx</code>).
500      */

501     public static final Unit<MagneticFlux> MAXWELL = WEBER.times(1e-8).label(
502             "Mx");
503
504     ///////////////////////////
505
// Magnetic Flux Density //
506
///////////////////////////
507

508     /**
509      * A unit of magnetic flux density equal <code>1000 A/m</code>
510      * (default label <code>G</code>).
511      */

512     public static final Unit<MagneticFluxDensity> GAUSS = TESLA.times(1e-4)
513             .label("G");
514
515     //////////
516
// Mass //
517
//////////
518

519     /**
520      * A unit of mass equal to 1/12 the mass of the carbon-12 atom
521      * (default label <code>u</code>).
522      */

523     public static final Unit<Mass> ATOMIC_MASS = KILOGRAM.times(
524             1e-3 / AVOGADRO_CONSTANT).label("u");
525
526     /**
527      * A unit of mass equal to the mass of the electron
528      * (default label <code>me</code>).
529      */

530     public static final Unit<Mass> ELECTRON_MASS = KILOGRAM.times(
531             9.10938188e-31).label("me");
532
533     /**
534      * A unit of mass equal to <code>200 mg</code>
535      * (default label <code>carat</code>).
536      */

537     public static final Unit<Mass> CARAT = KILOGRAM.times(200e-6)
538             .label("carat");
539
540     /**
541      * A unit of mass equal to <code>453.59237 grams</code> (avoirdupois pound,
542      * default label <code>lb</code>).
543      */

544     public static final Unit<Mass> POUND = KILOGRAM.times(AVOIRDUPOIS_POUND)
545             .label("lb");
546
547     /**
548      * A unit of mass equal to <code>1 / 16 {@link #POUND}</code>
549      * (default label <code>oz</code>).
550      */

551     public static final Unit<Mass> OUNCE = POUND.times(1.0 / 16.0).label("oz");
552
553     /**
554      * A unit of mass equal to <code>2000 {@link #POUND}</code> (short ton,
555      * default label <code>ton_us</code>).
556      */

557     public static final Unit<Mass> TON_US = POUND.times(2000).label("ton_us");
558
559     /**
560      * A unit of mass equal to <code>2240 {@link #POUND}</code> (long ton,
561      * default label <code>ton_uk</code>).
562      */

563     public static final Unit<Mass> TON_UK = POUND.times(2240).label("ton_uk");
564
565     /**
566      * A unit of mass equal to <code>1000 kg</code> (metric ton,
567      * default label <code>t</code>).
568      */

569     public static final Unit<Mass> METRIC_TON = KILOGRAM.times(1000).label("t");
570
571     ///////////
572
// Force //
573
///////////
574

575     /**
576      * A unit of force equal to <code>1E-5 N</code>
577      * (default label <code>dyn</code>).
578      */

579     public static final Unit<Force> DYNE = NEWTON.times(1e-5).label("dyn");
580
581     /**
582      * A unit of force equal to <code>9.80665 N</code>
583      * (default label <code>kgf</code>).
584      */

585     public static final Unit<Force> KILOGRAM_FORCE = NEWTON.times(
586             STANDARD_GRAVITY).label("kgf");
587
588     /**
589      * A unit of force equal to <code>{@link #POUND}·{@link #G}</code>
590      * (default label <code>lbf</code>).
591      */

592     public static final Unit<Force> POUND_FORCE = NEWTON.times(
593             AVOIRDUPOIS_POUND * STANDARD_GRAVITY).label("lbf");
594
595     ///////////
596
// Power //
597
///////////
598

599     /**
600      * A unit of power equal to the power required to raise a mass of 75
601      * kilograms at a velocity of 1 meter per second (metric,
602      * default label <code>hp</code>).
603      */

604     public static final Unit<Power> HORSEPOWER = WATT.times(735.499)
605             .label("hp");
606
607     //////////////
608
// Pressure //
609
//////////////
610

611     /**
612      * A unit of pressure equal to the average pressure of the Earth's
613      * atmosphere at sea level (default label <code>atm</code>).
614      */

615     public static final Unit<Pressure> ATMOSPHERE = PASCAL.times(101325).label(
616             "atm");
617
618     /**
619      * A unit of pressure equal to <code>100 kPa</code>
620      * (default label <code>bar</code>).
621      */

622     public static final Unit<Pressure> BAR = PASCAL.times(100e3).label("bar");
623
624     /**
625      * A unit of pressure equal to <code>1E-3 {@link #BAR}</code>
626      * (default label <code>mbar</code>).
627      */

628     public static final Unit<Pressure> MILLIBAR = BAR.times(1.0 / 1000.0)
629             .label("mbar");
630
631     /**
632      * A unit of pressure equal to the pressure exerted at the Earth's
633      * surface by a column of mercury 1 millimeter high
634      * (default label <code>mmHg</code>).
635      */

636     public static final Unit<Pressure> MILLIMETER_OF_MERCURY = PASCAL.times(
637             133.322).label("mmHg");
638
639     /**
640      * A unit of pressure equal to the pressure exerted at the Earth's
641      * surface by a column of mercury 1 inch high
642      * (default label <code>inHg</code>).
643      */

644     public static final Unit<Pressure> INCH_OF_MERCURY = PASCAL.times(3386.388)
645             .label("inHg");
646
647     /////////////////////////////
648
// Radiation dose absorbed //
649
/////////////////////////////
650

651     /**
652      * A unit of radiation dose absorbed equal to a dose of 0.01 joule of
653      * energy per kilogram of mass (J/kg) (default label <code>rd</code>).
654      */

655     public static final Unit<RadiationDoseAbsorbed> RAD = GRAY.times(0.01)
656             .label("rd");
657
658     /**
659      * A unit of radiation dose effective equal to <code>0.01 Sv</code>
660      * (default label <code>rem</code>).
661      */

662     public static final Unit<RadiationDoseEffective> REM = SIEVERT.times(0.01)
663             .label("rem");
664
665     //////////////////////////
666
// Radioactive activity //
667
//////////////////////////
668

669     /**
670      * A unit of radioctive activity equal to the activity of a gram of radium
671      * (default label <code>Ci</code>).
672      */

673     public static final Unit<RadioactiveActivity> CURIE = BECQUEREL.times(
674             3.7e10).label("Ci");
675
676     /**
677      * A unit of radioctive activity equal to 1 million radioactive
678      * disintegrations per second (default label <code>Rd</code>).
679      */

680     public static final Unit<RadioactiveActivity> RUTHERFORD = SI.BECQUEREL
681             .times(1e6).label("Rd");
682
683     /////////////////
684
// Solid angle //
685
/////////////////
686

687     /**
688      * A unit of solid angle equal to <code>4 <i>&pi;</i> steradians</code>
689      * (default label <code>sphere</code>).
690      */

691     public static final Unit<SolidAngle> SPHERE = STERADIAN.times(4.0 * PI)
692             .label("sphere");
693
694     /////////////////
695
// Temperature //
696
/////////////////
697

698     /**
699      * A unit of temperature equal to <code>5/9 °K</code>
700      * (default label <code>°R</code>).
701      */

702     public static final Unit<Temperature> RANKINE = KELVIN.times(5.0 / 9.0)
703             .label("°R");
704
705     /**
706      * A unit of temperature equal to degree Rankine minus
707      * <code>459.67 °R</code> (default label <code>°F</code>).
708      * @see #RANKINE
709      */

710     public static final Unit<Temperature> FAHRENHEIT = RANKINE.plus(459.67)
711             .label("°F");
712
713     //////////////
714
// Velocity //
715
//////////////
716

717     /**
718      * A unit of velocity equal to one {@link #NAUTICAL_MILE} per {@link #HOUR}.
719      */

720     public static final Unit<Velocity> KNOT = NAUTICAL_MILE.divide(HOUR);
721
722     /**
723      * A unit of velocity to express the speed of an aircraft relative to
724      * the speed of sound (default label <code>Mach</code>).
725      */

726     public static final Unit<Velocity> MACH = METER_PER_SECOND.times(331.6)
727             .label("Mach");
728
729     /**
730      * A unit of velocity relative to the speed of light
731      * (default label <code>c</code>).
732      */

733     public static final Unit<Velocity> C = METER_PER_SECOND.times(299792458.0)
734             .label("c");
735
736     ////////////
737
// Volume //
738
////////////
739

740     /**
741      * A unit of volume equal to one cubic decimeter (default label
742      * <code>L</code>, also recognized <code>µL, mL, cL, dL</code>).
743      */

744     public static final Unit<Volume> LITER = CUBIC_METER.times(0.001)
745             .label("L");
746     static {
747         LITER.times(1e-6).label("µL");
748         LITER.times(1e-3).label("mL");
749         LITER.times(1e-2).label("cL");
750         LITER.times(1e-1).label("dL");
751     }
752
753     /**
754      * A unit of volume equal to one cubic inch (<code>in³</code>).
755      */

756     public static final Unit<Volume> CUBIC_INCH = INCH.pow(3);
757
758     /**
759      * A unit of volume equal to one US gallon, Liquid Unit. The U.S. liquid
760      * gallon is based on the Queen Anne or Wine gallon occupying 231 cubic
761      * inches (default label <code>gal</code>).
762      */

763     public static final Unit<Volume> GALLON_LIQUID_US = CUBIC_INCH.times(231)
764             .label("gal");
765
766     /**
767      * A unit of volume equal to <code>1 / 8 {@link #GALLON_LIQUID_US}</code>
768      * (default label <code>pint</code>).
769      */

770     public static final Unit<Volume> PINT_LIQUID_US = GALLON_LIQUID_US.times(
771             1.0 / 8.0).label("pint");
772
773     /**
774      * A unit of volume equal to <code>1 / 16 {@link #PINT_LIQUID_US}</code>
775      * (default label <code>oz_fl</code>).
776      */

777     public static final Unit<Volume> FLUID_OUNCE_US = PINT_LIQUID_US.times(
778             1.0 / 16.0).label("oz_fl");
779
780     /**
781      * A unit of volume equal to one US dry gallon.
782      * (default label <code>gallon_dry_us</code>).
783      */

784     public static final Unit<Volume> GALLON_DRY_US = CUBIC_INCH.times(268.8025)
785             .label("gallon_dry_us");
786
787     /**
788      * A unit of volume equal to <code>1 / 8 {@link #GALLON_DRY_US}</code>
789      * (default label <code>pint_dry_us</code>).
790      */

791     public static final Unit<Volume> PINT_DRY_US = GALLON_DRY_US.times(
792             1.0 / 8.0).label("pint_dry_us");
793
794     /**
795      * A unit of volume equal to <code>4.546 09 {@link #LITER}</code>
796      * (default label <code>gal_uk</code>).
797      */

798     public static final Unit<Volume> GALLON_UK = LITER.times(4.54609).label(
799             "gallon_uk");
800
801     /**
802      * A unit of volume equal to <code>1 / 8 {@link #GALLON_UK}</code>
803      * (default label <code>pint_uk</code>).
804      */

805     public static final Unit<Volume> PINT_UK = GALLON_UK.times(1.0 / 8.0)
806             .label("pint_uk");
807
808     /**
809      * A unit of volume equal to <code>1 / 160 {@link #GALLON_UK}</code>
810      * (default label <code>oz_fl_uk</code>).
811      */

812     public static final Unit<Volume> FLUID_OUNCE_UK = GALLON_UK.times(
813             1.0 / 160.0).label("oz_fl_uk");
814
815     /**
816      * A unit of volume equal to <code>8 {@link #FLUID_OUNCE_US}</code>
817      * (default label <code>cup_us</code>).
818      */

819     public static final Unit<Volume> CUP_US = FLUID_OUNCE_US.times(8).label(
820             "cup_us");
821
822     /**
823      * A unit of volume equal to <code>10 {@link #FLUID_OUNCE_UK}</code>
824      * (default label <code>cup_uk</code>).
825      */

826     public static final Unit<Volume> CUP_UK = FLUID_OUNCE_UK.times(10).label(
827             "cup_uk");
828
829     /**
830      * A unit of volume equal to <code>1 / 2 {@link #FLUID_OUNCE_US}</code>
831      * (default label <code>tablespoon_us</code>).
832      */

833     public static final Unit<Volume> TABLESPOON_US = FLUID_OUNCE_US.times(
834             1.0 / 2.0).label("tablespoon_us");
835
836     /**
837      * A unit of volume equal to one <code>5 / 8 {@link #FLUID_OUNCE_UK}</code>
838      * (default label <code>tablespoon_uk</code>).
839      */

840     public static final Unit<Volume> TABLESPOON_UK = FLUID_OUNCE_UK.times(
841             5.0 / 8.0).label("tablespoon_uk");
842
843     /**
844      * A unit of volume equal to <code>1 / 6 {@link #FLUID_OUNCE_US}</code>
845      * (default label <code>teaspoon_us</code>).
846      */

847     public static final Unit<Volume> TEASPOON_US = FLUID_OUNCE_US.times(
848             1.0 / 6.0).label("teaspoon_us");
849
850     /**
851      * A unit of volume equal to <code>1 / 6 {@link #FLUID_OUNCE_UK}</code>
852      * (default label <code>teaspoon_uk</code>).
853      */

854     public static final Unit<Volume> TEASPOON_UK = FLUID_OUNCE_UK.times(
855             1.0 / 6.0).label("teaspoon_uk");
856
857     /**
858      * A unit of volume equal to <code>20.0 mL</code> (Australian tablespoon,
859      * (default label <code>tablespoon_au</code>).
860      */

861     public static final Unit<Volume> TABLESPOON_AU = CUBIC_METER.times(20.0e-6)
862             .label("tablespoon_au");
863
864     ////////////
865
// Others //
866
////////////
867

868     /**
869      * A unit used to measure the ionizing ability of radiation
870      * (default label <code>Roentgen</code>).
871      */

872     public static final Unit ROENTGEN = COULOMB.divide(KILOGRAM).times(2.58e-4)
873             .label("Roentgen");
874
875     /**
876      * Static method to force class initialization.
877      */

878     static void initializeClass() {
879     }
880
881 }
Popular Tags