import { GenericMeasure } from "../measure/genericMeasure" ; import { Measure } from "../measure/numberMeasure" ; import { radians } from "./base" ; import { Length , PlaneAngle } from "./quantities" ; param x returns export const acos = wrapInverseTrigFn ( Math . acos ) ; param x returns export const asin = wrapInverseTrigFn ( Math . asin ) ; param x returns export const atan = wrapInverseTrigFn ( Math . atan ) ; param x returns export const cos = wrapTrigFn ( Math . cos ) ; param x returns export const sin = wrapTrigFn ( Math . sin ) ; param x returns export const tan = wrapTrigFn ( Math . tan ) ; param x param y returns export function atan2 ( y , x ) { return Measure . of ( Math . atan2 ( y . value , x . value ) , radians ) ; } type Dimensionless = GenericMeasure < number , { } > ; function wrapTrigFn ( f ) { return angle => Measure . dimensionless ( f ( angle . value ) ) ; } function wrapInverseTrigFn ( f ) { return angle => Measure . of ( f ( angle . value ) , radians ) ; }