import { angularSum , defaultInterpetLandmark , } from 'analyses/helpers' ; import { NSAr , SArGo , ArGoMe , FMIA } from 'analyses/landmarks/angles/skeletal' ; import { L1Axis } from 'analyses/landmarks/lines/skeletal' ; import { calculateAngle , getVectorPoints , createVectorFromPoints , rotatePointAroundOrigin , degreesToRadians , radiansToDegrees , } from 'utils/math' ; export const bjorkSum = { ... angularSum ( [ NSAr , SArGo , ArGoMe ] , 'Björk\'s sum' , 'Björk' ) , interpret : defaultInterpetLandmark ( 'growthPattern' , [ 'horizontal' , 'normal' , 'vertical' ] ) , } ; export const cephCorrection = { name : 'Cephalometric correction' , symbol : 'ceph-correction' , type : 'distance' , components : [ FMIA , L1Axis ] , imageType : 'ceph_lateral' , unit : 'mm' , map ( geoFMIA , axis ) { const actualAngle = calculateAngle ( geoFMIA ) ; const rotation = actualAngle - degreesToRadians ( 65 ) ; const [ apex , edge ] = getVectorPoints ( axis ) ; const newEdge = rotatePointAroundOrigin ( apex , edge , rotation ) ; return createVectorFromPoints ( apex , newEdge ) ; } , calculate : ( ) => ( geoFMIA ) => ( ) => { const actualAngle = calculateAngle ( geoFMIA ) ; const rotation = actualAngle - degreesToRadians ( 65 ) ; return 0.8 * radiansToDegrees ( rotation ) ; } , } ;