library / com.otaliastudios.opengl.geometry / SegmentF

SegmentF

open class SegmentF

Constructors

<init>

SegmentF(i: <ERROR CLASS>, j: <ERROR CLASS>)
SegmentF(ix: Float, iy: Float, jx: Float, jy: Float)

Properties

ix

val ix: Float

iy

val iy: Float

jx

val jx: Float

jy

val jy: Float

length

val length: Float

Functions

intersects

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

open fun intersects(other: SegmentF): Boolean

orientation

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

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

Inheritors

IndexedSegmentF

class IndexedSegmentF : SegmentF