3

I want to calculate the speed of a car:

   180 km / 2 hour
    (*  25 m/s *)

this is a simple question, but I do not know how to implement

tiankonghewo
  • 605
  • 4
  • 10

1 Answers1

12

See the documentation on UnitDiscovery and Quantity and UnitConvert.

A few things that gave me trouble at first were (1) the units are always strings; they are capitalized and they are plural. For example

{Quantity[180, "Kilometers"], 
Quantity[2,"Hours"],
Quantity[6,"Feet"]}

(2) When PhysicalConstants are entered, they are not plural. For example,

Quantity[5,"ElectronCharge"]
UnitConvert[%,"SIBase"]

(3) To find out how to enter a quantity, use the Ctrl= key and the InputForm function. For example:

Ctrl= 1 amp   //InputForm
Ctrl= -10 V   //InputForm
Ctrl= 21.1kΩ  //InputForm
Ctrl= 0.53 Å  //InputForm

Please see the documentation. Also, searching this forum for previous questions about Quantity and UnitConvert is highly recommended.

LouisB
  • 12,528
  • 1
  • 21
  • 31
  • Note that while most units are plural, there are several exceptions. For example: "UkraineSovietRuble" and "AstronomicalUnit". An absence of pluralization is most commonly seen with currency units. – theorist Mar 27 '17 at 01:53