library / com.otaliastudios.opengl.geometry / IndexedSegmentF

IndexedSegmentF

class IndexedSegmentF : SegmentF

Constructors

<init>

IndexedSegmentF(i: IndexedPointF, j: IndexedPointF)
IndexedSegmentF(i: Int, j: Int, ix: Float, iy: Float, jx: Float, jy: Float)

Properties

i

val i: Int

j

val j: Int

Inherited Properties

ix

val ix: Float

iy

val iy: Float

jx

val jx: Float

jy

val jy: Float

length

val length: Float

Functions

hasIndex

fun hasIndex(index: Int): Boolean

intersects

fun intersects(other: SegmentF): Boolean

Not an easy task. Some references: https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/algorithm/RobustLineIntersector.java https://stackoverflow.com/questions/3838329/how-can-i-check-if-two-segments-intersect

Inherited Functions

orientation

fun orientation(x: Float, y: Float): Int

Returns -1 if the point is clockwise (right) from us. Returns +1 if the point is counterclockwise (left) from us. 0 if the point is collinear. https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/algorithm/CGAlgorithmsDD.java#L47-L53