import { distance , defaultInterpetLandmark } from 'analyses/helpers' ; import { L1_INCISAL_EDGE , U1_INCISAL_EDGE , } from 'analyses/landmarks/points/skeletal' ; import { functionalOcclusalPlane , } from 'analyses/landmarks/lines/dental' ; import { createPerpendicular , createVectorFromPoints , getIntersectionPoint , getSegmentLength , } from 'utils/math' ; export const overjet = { type : 'distance' , symbol : 'overjet' , unit : 'mm' , imageType : 'ceph_lateral' , components : [ functionalOcclusalPlane , U1_INCISAL_EDGE , L1_INCISAL_EDGE ] , map : ( occlusalPlane , u1Tip , l1Tip ) => { const p1 = createPerpendicular ( occlusalPlane , u1Tip ) ; const p2 = createPerpendicular ( occlusalPlane , l1Tip ) ; const point1 = getIntersectionPoint ( occlusalPlane , p1 ) as GeoPoint ; const point2 = getIntersectionPoint ( occlusalPlane , p2 ) as GeoPoint ; return createVectorFromPoints ( point1 , point2 ) ; } , calculate : ( ) => ( ) => ( segment ) => { return getSegmentLength ( segment ) ; } , interpret ( value , min , max , mean ) { if ( value < 0 ) { return [ { category : 'overjet' , indication : 'negative' , max , min , mean , value , } ] ; } return defaultInterpetLandmark ( 'overjet' , [ 'decreased' , 'normal' , 'increased' ] ) ( value , min , max , mean ) ; } , } ; export const overbite = { type : 'distance' , symbol : 'overbite' , unit : 'mm' , imageType : 'ceph_lateral' , components : [ distance ( L1_INCISAL_EDGE , functionalOcclusalPlane ) , distance ( U1_INCISAL_EDGE , functionalOcclusalPlane ) , ] , calculate : ( l1Distance , u1Distance ) => ( ) => ( ) => { return u1Distance - l1Distance ; } , interpret ( value , min , max , mean ) { if ( value < 0 ) { return [ { category : 'overbite' , indication : 'negative' , max , min , mean , value , } ] ; } return defaultInterpetLandmark ( 'overbite' , [ 'decreased' , 'normal' , 'increased' ] ) ( value , min , max , mean ) ; } , } ;