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
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
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.
Quantity[]andUnitConvert[]can help. – Michael E2 Dec 02 '16 at 02:39