From f5201b6be0c2cf784e2a192193d2f7130caac857 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 4 Apr 2023 17:42:40 +0300 Subject: [PATCH] refactoring directions --- .../kotlin/space/kscience/kmath/trajectory/Obstacle.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Obstacle.kt b/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Obstacle.kt index c4ff34295..553ca0388 100644 --- a/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Obstacle.kt +++ b/kmath-trajectory/src/commonMain/kotlin/space/kscience/kmath/trajectory/Obstacle.kt @@ -69,7 +69,7 @@ internal fun Circle2D.tangentsToCircle( } else { angle1 - r2.sign * atan2(r.absoluteValue, l) } - val w = Euclidean2DSpace.vector(-cos(angle2), sin(angle2)) + val w = vector(-cos(angle2), sin(angle2)) put( route, LineSegment( @@ -412,7 +412,7 @@ private fun sortedObstacles( currentObstacle: Obstacle, obstacles: List, ): List { - return obstacles.sortedBy { norm(it.center - currentObstacle.center) }//.reversed() + return obstacles.sortedBy { norm(it.center - currentObstacle.center) } } private fun tangentsAlongTheObstacle( @@ -580,7 +580,6 @@ internal fun findAllPaths( newPaths.add(TangentPath(tangentPath.tangents + tangentsAlong + tangent)) } } else { - // minor changes from Python code newPaths.add(tangentPath) } }