10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-18 12:03:40 +01:00
QCaml/Utils/Units.ml

26 lines
346 B
OCaml
Raw Normal View History

2018-01-02 22:33:17 +01:00
type units =
| Bohr
| Angstrom
2018-01-17 15:56:57 +01:00
type angle_units =
| Degree
| Radian
let pi = acos (-1.)
let to_degree x =
assert (x <= 2.*.pi);
assert (x >= -2.*.pi);
x *. 180. /. pi
let to_radian x =
assert (x <= 360.);
assert (x >= -360.);
x *. pi /. 180.
2018-01-02 22:33:17 +01:00
let angstrom_to_bohr = 1. /. 0.52917721092
let bohr_to_angstrom = 0.52917721092
;;