alchemist-interfaces / it.unibo.alchemist.model.interfaces / Obstacle2D / nearestIntersection

nearestIntersection

abstract fun nearestIntersection(startx: Double, starty: Double, endx: Double, endy: Double): DoubleArray!

Given a vector (represented as a starting point and an end point) and a rectangle, computes the intersection point between the vector and the rectangle nearest to the vector's starting point.

Parameters

startx - Double: start x coordinate of the vector

starty - Double: start y coordinate of the vector

endx - Double: end x coordinate of the vector

endy - Double: end y coordinate of the vector

Return
DoubleArray!: the intersection point between the vector and the rectangle nearest to the vector's starting point