Java API By Example, From Geeks To Geeks.

# Java > Open Source Codes > org > jscience > physics > quantities > Torque

 `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 is7  * freely granted, provided that this notice is preserved.8  */9 package org.jscience.physics.quantities;10 11 import org.jscience.physics.units.SI;12 import org.jscience.physics.units.Unit;13 14 /**15  * This class represents the moment of a force. The system unit for this16  * quantity is "N·m".17  *

Note: The Newton-metre ("N·m") is also a way of exressing a Joule (unit18  * of energy). However, torque is not energy. So, to avoid confusion, we19  * will use the units "N·m" for torque and not "J". This distinction occurs20  * due to the scalar nature of energy and the vector nature of torque.

21  *22  * @author Jean-Marie Dautelle23  * @version 1.0, October 24, 200424  */25 public class Torque extends Quantity {26 27     /**28      * Holds the associated unit.29      */30     private final static Unit UNIT = SI.NEWTON.times(SI.METER);31 32     /**33      * Holds the factory for this class.34      */35     private final static Factory FACTORY = new Factory(UNIT) {36         protected Torque create() {37             return new Torque();38         }39     };40 41     /**42      * Represents a {@link Torque} amounting to nothing.43      */44     public final static Torque ZERO = Quantity.valueOf(0, UNIT);45 46     /**47      * Default constructor (allows for derivation).48      */49     protected Torque() {50     }51 52     /**53      * Shows {@link Torque} instances in the specified unit.54      *55      * @param unit the display unit for {@link Torque} instances.56      */57     public static void showAs(Unit unit) {58         QuantityFormat.show(Torque.class, unit);59     }60 61     private static final long serialVersionUID = 1L;62 63 }64 ` Popular Tags