LineSeg

final class LineSeg(val startX: Double, val startY: Double, val endX: Double, val endY: Double) extends LineSegLike[Pt2] with LineLike with CurveSeg with Show2[Pt2, Pt2] with ElemDbl4 with AffinePreserve

Straight line segment. A straight line in every day terminology. Mathematically: 2 dimensional directed, line segment. The name was chosen to avoid ambiguity.

Companion:
object
trait ElemDbl4
trait ElemDblN
trait SpecialT
trait Show2[Pt2, Pt2]
trait TypeStr2[Pt2, Pt2]
trait ShowDec
trait Show
trait TypeStr
trait CurveSeg
trait Drawable
trait LineLike
trait GeomElem
class Object
trait Matchable
class Any

Type members

Types

override type ThisT = LineSeg

Value members

Concrete methods

The angle of this line segment.

The angle of this line segment.

override def dbl1: Double
Definition Classes
override def dbl2: Double
Definition Classes
override def dbl3: Double
Definition Classes
override def dbl4: Double
Definition Classes
def draw(colour: Colour, lineWidth: Double): LineSegDraw
def endPt: Pt2
def endToLeft(distFromEnd: Double): Pt2

Gives the Vec2 point at the specified distance to the left of the end point. At the end point turn left 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

Gives the Vec2 point at the specified distance to the left of the end point. At the end point turn left 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

def endToRight(distFromEnd: Double): Pt2

Gives the Vec2 point at the specified distance to the right of the end point. At the end point turn right 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

Gives the Vec2 point at the specified distance to the right of the end point. At the end point turn right 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

def func4Dou[T](f: (Double, Double, Double, Double) => T): T
def isHorizontal: Boolean
def isVertical: Boolean

The angle 90 degrees anti-clock wise from the angle of this directed line segment. The angle one gets by turning left from this Sline.

The angle 90 degrees anti-clock wise from the angle of this directed line segment. The angle one gets by turning left from this Sline.

@inline
def length: Double
def midPt: Pt2

The mid or half way point of this lineSeg.

The mid or half way point of this lineSeg.

def midPtToLeft(distFromMidPt: Double): Pt2

Gives the Vec2 point at the specified distance to the left of the mid point. At the mid point turn left 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

Gives the Vec2 point at the specified distance to the left of the mid point. At the mid point turn left 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

def midPtToRight(distFromMidPt: Double): Pt2

Gives the Vec2 point at the specified distance to the right of the mid point. At the mid point turn right 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

Gives the Vec2 point at the specified distance to the right of the mid point. At the mid point turn right 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

def mirrorPt(pt: Pt2): Pt2
override def name1: String
Definition Classes
override def name2: String
Definition Classes
def ptsTrans(f: Pt2 => Pt2): LineSeg
def rayIntersection(pt: Pt2): Boolean

Checks whether a forward horizontal ray crosses this polygon side.

Checks whether a forward horizontal ray crosses this polygon side.

The relative vector Vec2 of the start point from the end point.

The relative vector Vec2 of the start point from the end point.

The angle 90 degrees clock wise from the angle of this line segment. The angle one gets by turning from from this Sline.

The angle 90 degrees clock wise from the angle of this line segment. The angle one gets by turning from from this Sline.

def shortArray: Array[Short]
override def show1: Pt2
Definition Classes
override def show2: Pt2
Definition Classes
def startToLeft(distFromStart: Double): Pt2

Gives the Vec2 point at the specified distance to the left of the start point. At the start point turn left 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

Gives the Vec2 point at the specified distance to the left of the start point. At the start point turn left 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

def startToRight(distFromStart: Double): Pt2

Gives the Vec2 point at the specified distance to the right of the start point. At the start point turn right 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

Gives the Vec2 point at the specified distance to the right of the start point. At the start point turn right 90 degrees and then travel the given distance to the point. The Vec2 of that point is returned by this method.

override def syntaxDepth: Int
Definition Classes
override def typeStr: String
Definition Classes
def vec: Vec2

The relative vector Vec2 of the end point from the start point.

The relative vector Vec2 of the end point from the start point.

def withArrow(colour: Colour, lineWidth: Double): GraphicElems

Inherited methods

def el1Show(style: ShowStyle, maxPlaces: Int): String
Inherited from:
Show2
def el2Show(style: ShowStyle, maxPlaces: Int): String
Inherited from:
Show2
Inherited from:
Show2
Inherited from:
Show2
override def negX: ThisT
Definition Classes
Inherited from:
SimilarPreserve
override def negY: ThisT
Definition Classes
Inherited from:
SimilarPreserve
override def opt1: Option[Pt2]

The optional default value for parameter 1.

The optional default value for parameter 1.

Definition Classes
Inherited from:
Show2
override def opt2: Option[Pt2]

The optional default value for parameter 2.

The optional default value for parameter 2.

Definition Classes
Inherited from:
Show2
final def pEnd: Pt2

The end point Pt2 of this curve segment. Often called p2 on a line or p4 on a cubic bezier in other APIs.

The end point Pt2 of this curve segment. Often called p2 on a line or p4 on a cubic bezier in other APIs.

Inherited from:
CurveSeg
final def pStart: Pt2

Start point of this curve segment, often called p1

Start point of this curve segment, often called p1

Inherited from:
CurveSeg
override def prolign(matrix: ProlignMatrix): ThisT
Definition Classes
Inherited from:
ProlignPreserve
override def reflect(lineLike: LineLike): ThisT
Definition Classes
Inherited from:
SimilarPreserve
override def rotate(angle: AngleVec): ThisT
Definition Classes
Inherited from:
SimilarPreserve
override def rotate180: ThisT
Definition Classes
Inherited from:
SimilarPreserve
override def rotate270: ThisT
Definition Classes
Inherited from:
SimilarPreserve
override def rotate90: ThisT
Definition Classes
Inherited from:
SimilarPreserve
override def scale(operand: Double): ThisT
Definition Classes
Inherited from:
ProlignPreserve
override def scaleXY(xOperand: Double, yOperand: Double): ThisT
Definition Classes
Inherited from:
AffinePreserve
override def shearX(operand: Double): ThisT
Definition Classes
Inherited from:
AffinePreserve
override def shearY(operand: Double): ThisT
Definition Classes
Inherited from:
AffinePreserve
override def show(style: ShowStyle): String
Definition Classes
Inherited from:
ShowDec
override def showDec(style: ShowStyle, maxPlaces: Int, minPlaces: Int): String
Definition Classes
Inherited from:
ShowProductDec
def showDec(style: ShowStyle, maxPlaces: Int): String

Intended to be a multiple parameter comprehensive Show method. Intended to be paralleled by showT method on ShowDecT type class instances.

Intended to be a multiple parameter comprehensive Show method. Intended to be paralleled by showT method on ShowDecT type class instances.

Inherited from:
ShowDec
def showElemStrDecs(way: ShowStyle, decimalPlaces: Int): Strings
Inherited from:
Show2
override def showElemStrs(way: ShowStyle): Strings
Definition Classes
Inherited from:
ShowProductDec
def showSemisNameDecs(maxPlaces: Int, minPlaces: Int): String
Inherited from:
ShowProductDec
def showSemisNames: String
Inherited from:
ShowProduct
override def slateXY(xDelta: Double, yDelta: Double): ThisT
Definition Classes
Inherited from:
ProlignPreserve
override def str: String
Definition Classes
Inherited from:
ShowDec
def str0: String

Show with decimal precision of 0 places.

Show with decimal precision of 0 places.

Inherited from:
ShowDec
def str1: String

Show with decimal precision of 1 place padding with a zero if necessary.

Show with decimal precision of 1 place padding with a zero if necessary.

Inherited from:
ShowDec
def str2: String

Show with decimal precision of 2 places padding with zeros if necessary.

Show with decimal precision of 2 places padding with zeros if necessary.

Inherited from:
ShowDec
def str3: String

Show with decimal precision of 3 places padding with zeros if necessary.

Show with decimal precision of 3 places padding with zeros if necessary.

Inherited from:
ShowDec
override def toString: String
Definition Classes
Show -> Any
Inherited from:
Show

Concrete fields

val endX: Double
val endY: Double
val startX: Double
val startY: Double

Implicits

Implicits

implicit override def showT1: ShowDecT[Pt2]
Definition Classes
implicit override def showT2: ShowDecT[Pt2]
Definition Classes