File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -287,17 +287,20 @@ class BuildingShapeUtils extends ShapeUtils {
287287 p0 = points [ points . length - 1 ] ;
288288 p1 = points [ 0 ] ;
289289 p2 = points [ 1 ] ;
290- angles . push ( Math . atan ( ( p2 . y - p1 . y ) / ( p2 . x - p1 . x ) ) - Math . atan ( ( p0 . y - p1 . y ) / ( p0 . x - p1 . x ) ) ) ;
290+ let angle = Math . atan2 ( p2 . y - p1 . y , p2 . x - p1 . x ) - Math . atan2 ( p0 . y - p1 . y , p0 . x - p1 . x )
291+ angles . push ( angle ) ;
291292 for ( let i = 1 ; i < points . length - 2 ; i ++ ) {
292293 p0 = points [ i - 1 ] ;
293294 p1 = points [ i ] ;
294295 p2 = points [ i + 1 ] ;
295- angles . push ( Math . atan ( ( p2 . y - p1 . y ) / ( p2 . x - p1 . x ) ) - Math . atan ( ( p0 . y - p1 . y ) / ( p0 . x - p1 . x ) ) ) ;
296+ angle = Math . atan2 ( p2 . y - p1 . y , p2 . x - p1 . x ) - Math . atan2 ( p0 . y - p1 . y , p0 . x - p1 . x )
297+ angles . push ( angle ) ;
296298 }
297299 p0 = points [ 0 ] ;
298300 p1 = points [ points . length - 1 ] ;
299301 p2 = points [ points . length - 2 ] ;
300- angles . push ( Math . atan ( ( p2 . y - p1 . y ) / ( p2 . x - p1 . x ) ) - Math . atan ( ( p0 . y - p1 . y ) / ( p0 . x - p1 . x ) ) ) ;
302+ angle = Math . atan2 ( p2 . y - p1 . y , p2 . x - p1 . x ) - Math . atan2 ( p0 . y - p1 . y , p0 . x - p1 . x )
303+ angles . push ( angle ) ;
301304 return angles ;
302305 }
303306
You can’t perform that action at this time.
0 commit comments