@@ -13,10 +13,11 @@ export default function calculateArcControlPoints(config: ArcConfig): ControlPoi
1313 lat : config . endLocation . geometry . coordinates [ 1 ] ,
1414 }
1515
16- if ( ! startCoords . lat || ! startCoords . lon || ! endCoords . lat || ! endCoords . lon ) throw Error ( "Invalid coordinates" )
16+ if ( ! startCoords . lat || ! startCoords . lon || ! endCoords . lat || ! endCoords . lon )
17+ throw Error ( 'Invalid coordinates' )
1718
18- const startVec3 = calculateVec3FromLatLon ( startCoords . lat , startCoords . lon , 600 )
19- const endVec3 = calculateVec3FromLatLon ( endCoords . lat , endCoords . lon , 600 )
19+ const startVec3 = calculateVec3FromLatLon ( startCoords . lon , startCoords . lat , 600 )
20+ const endVec3 = calculateVec3FromLatLon ( endCoords . lon , endCoords . lat , 600 )
2021 const arcHeight = startVec3 . distanceTo ( endVec3 ) * config . height ! + 600
2122
2223 const interpolate = geoInterpolate (
@@ -29,8 +30,8 @@ export default function calculateArcControlPoints(config: ArcConfig): ControlPoi
2930 end : interpolate ( 0.75 ) ,
3031 }
3132
32- const midStartVec3 = calculateVec3FromLatLon ( midCoords . start [ 1 ] , midCoords . start [ 0 ] , arcHeight )
33- const midEndVec3 = calculateVec3FromLatLon ( midCoords . end [ 1 ] , midCoords . end [ 0 ] , arcHeight )
33+ const midStartVec3 = calculateVec3FromLatLon ( midCoords . start [ 0 ] , midCoords . start [ 1 ] , arcHeight )
34+ const midEndVec3 = calculateVec3FromLatLon ( midCoords . end [ 0 ] , midCoords . end [ 1 ] , arcHeight )
3435
3536 return {
3637 start : startVec3 ,
0 commit comments