LineSeg

ostrat.geom.LineSeg
See theLineSeg companion object
final class LineSeg(val startX: Double, val startY: Double, val endX: Double, val endY: Double) extends LineSegLikeDbl4[Pt2] with LineLike with CurveSeg with Show2[Pt2, Pt2] 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.

Attributes

Companion:
object
Graph
Supertypes
trait Show2[Pt2, Pt2]
trait TypeStr2[Pt2, Pt2]
trait TypeStrN
trait ShowN
trait ShowDec
trait Show
trait TypeStr
trait CurveSeg
trait Drawable
trait LineLike
trait GeomElem
trait Dbl4Elem
trait DblNElem
trait SpecialT
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Types

override type ThisT = LineSeg

The most narrow type preserved in some 2d geometric transformations.

The most narrow type preserved in some 2d geometric transformations.

Attributes

Value members

Concrete methods

The angle of this line segment.

The angle of this line segment.

Attributes

override def dbl1: Double

Attributes

Definition Classes
override def dbl2: Double

Attributes

Definition Classes
override def dbl3: Double

Attributes

Definition Classes
override def dbl4: Double

Attributes

Definition Classes
def draw(colour: Colour, lineWidth: Double): LineSegDraw

Draws this geometric element to produce a GraphElem graphical element, tht can be displayed or printed.

Draws this geometric element to produce a GraphElem graphical element, tht can be displayed or printed.

Attributes

def endPt: Pt2

The end point of the LineSeglike. The type of start point will depend on the VT vertex type. For example a Pt2 for a LineSeg a PtM2 for a LineSegM2.

The end point of the LineSeglike. The type of start point will depend on the VT vertex type. For example a Pt2 for a LineSeg a PtM2 for a LineSegM2.

Attributes

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.

Attributes

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.

Attributes

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

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.

Attributes

def midPt: Pt2

The mid or half way point of this lineSeg.

The mid or half way point of this lineSeg.

Attributes

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.

Attributes

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.

Attributes

def mirrorPt(pt: Pt2): Pt2
override def name1: String

1st parameter name.

1st parameter name.

Attributes

Definition Classes
override def name2: String

2nd parameter name.

2nd parameter name.

Attributes

Definition Classes
def ptsTrans(f: Pt2 => Pt2): LineSeg

A method to perform all the ProlignPreserve transformations with a function from PT2 => PT2.

A method to perform all the ProlignPreserve transformations with a function from PT2 => PT2.

Attributes

Checks whether a forward horizontal ray crosses this polygon side.

Checks whether a forward horizontal ray crosses this polygon side.

Attributes

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

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

Attributes

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.

Attributes

override def show1: Pt2

Element 1 of this Show 2 element product.

Element 1 of this Show 2 element product.

Attributes

Definition Classes
override def show2: Pt2

Element 2 of this Show 2 element product.

Element 2 of this Show 2 element product.

Attributes

Definition Classes

The start point of the LineSeglike. The type of start point will depend on the VT vertex type. For example a Pt2 for a LineSeg a PtM2 for a LineSegM2.

The start point of the LineSeglike. The type of start point will depend on the VT vertex type. For example a Pt2 for a LineSeg a PtM2 for a LineSegM2.

Attributes

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.

Attributes

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.

Attributes

override def syntaxDepth: Int

Attributes

Definition Classes
override def typeStr: String

The RSON type of T. This the only data that a ShowT instance requires, that can't be implemented through delegation to an object of type Show.

The RSON type of T. This the only data that a ShowT instance requires, that can't be implemented through delegation to an object of type Show.

Attributes

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.

Attributes

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

Inherited methods

override def dblForeach(f: Double => Unit): Unit

Performs the side effecting function on each Double in this Product element.

Performs the side effecting function on each Double in this Product element.

Attributes

Definition Classes
Inherited from:
Dbl4Elem
def el1Show(style: ShowStyle, maxPlaces: Int): String

Attributes

Inherited from:
Show2
def el2Show(style: ShowStyle, maxPlaces: Int): String

Attributes

Inherited from:
Show2

A StrArr Arr of the element type names of this Show Product class.

A StrArr Arr of the element type names of this Show Product class.

Attributes

Inherited from:
Show2
def map[VB, LB <: LineSegLike[VB]](f: Pt2 => VB)(implicit build: LineSegLikeMapBuilder[VB, LB]): LB

Attributes

Inherited from:
LineSegLike
def mapOpt[VB, LB <: LineSegLike[VB]](f: Pt2 => Option[VB])(implicit build: LineSegLikeMapBuilder[VB, LB]): Option[LB]

Attributes

Inherited from:
LineSegLike
override def negX: ThisT

Mirror, reflection 2D geometric transformation across the Y axis by negating X. The return type will be narrowed in sub traits / classes.

Mirror, reflection 2D geometric transformation across the Y axis by negating X. The return type will be narrowed in sub traits / classes.

Attributes

Definition Classes
Inherited from:
SimilarPreserve
override def negY: ThisT

Mirror, reflection 2D geometric transformation across the X axis by negating y. The return type will be narrowed in sub traits / classes.

Mirror, reflection 2D geometric transformation across the X axis by negating y. The return type will be narrowed in sub traits / classes.

Attributes

Definition Classes
Inherited from:
SimilarPreserve
override def numParams: Int

Number of parameter constituents of this class.

Number of parameter constituents of this class.

Attributes

Definition Classes
Inherited from:
TypeStr2
override def opt1: Option[A1]

The optional default value for parameter 1.

The optional default value for parameter 1.

Attributes

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

The optional default value for parameter 2.

The optional default value for parameter 2.

Attributes

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.

Attributes

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

Attributes

Inherited from:
CurveSeg
override def paramNames: StrArr

Sequence of the names of parameter constituents of this class.

Sequence of the names of parameter constituents of this class.

Attributes

Definition Classes
Inherited from:
Show2
override def prolign(matrix: ProlignMatrix): ThisT

2D Transformation using a ProlignMatrix. The return type will be narrowed in sub classes / traits.

2D Transformation using a ProlignMatrix. The return type will be narrowed in sub classes / traits.

Attributes

Definition Classes
Inherited from:
ProlignPreserve
override def reflect(lineLike: LineLike): ThisT

Reflect 2D geometric transformation across a line, line segment or ray on a GeomElem. The return type will be narrowed in sub classes and traits.

Reflect 2D geometric transformation across a line, line segment or ray on a GeomElem. The return type will be narrowed in sub classes and traits.

Attributes

Definition Classes
Inherited from:
SimilarPreserve
override def rotate(angle: AngleVec): ThisT

Rotation 2D geometric transformation on a GeomElem. The return type will be narrowed in sub classes and traits.

Rotation 2D geometric transformation on a GeomElem. The return type will be narrowed in sub classes and traits.

Attributes

Definition Classes
Inherited from:
SimilarPreserve
override def rotate180: ThisT

Rotation of 180 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in sub classes and traits.

Rotation of 180 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in sub classes and traits.

Attributes

Definition Classes
Inherited from:
SimilarPreserve
override def rotate270: ThisT

Rotation positive or anti clockwise 270 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in sub classes and traits.

Rotation positive or anti clockwise 270 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in sub classes and traits.

Attributes

Definition Classes
Inherited from:
SimilarPreserve
override def rotate90: ThisT

Rotation positive or anti clockwise 90 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in sub classes and traits.

Rotation positive or anti clockwise 90 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in sub classes and traits.

Attributes

Definition Classes
Inherited from:
SimilarPreserve
override def scale(operand: Double): ThisT

Uniform 2D geometric scaling transformation. The scale name was chosen for this operation as it is normally the desired operation and preserves Circles and Squares. Use the xyScale method for differential scaling. The Return type will be narrowed in sub traits / classes.

Uniform 2D geometric scaling transformation. The scale name was chosen for this operation as it is normally the desired operation and preserves Circles and Squares. Use the xyScale method for differential scaling. The Return type will be narrowed in sub traits / classes.

Attributes

Definition Classes
Inherited from:
ProlignPreserve
override def scaleXY(xOperand: Double, yOperand: Double): ThisT

Scaling X and Y axes independently, 2D geometric transformation on this GeomElem, returns a new GeomElem. This allows different scaling factors across X and Y dimensions. The return type will be narrowed in sub classes and traits. This is an affine transformation but it is not a similar transformation.

Scaling X and Y axes independently, 2D geometric transformation on this GeomElem, returns a new GeomElem. This allows different scaling factors across X and Y dimensions. The return type will be narrowed in sub classes and traits. This is an affine transformation but it is not a similar transformation.

Attributes

Definition Classes
Inherited from:
AffinePreserve
override def shearX(operand: Double): ThisT

Shear 2D geometric transformation along the X Axis on a GeomElem. The return type will be narrowed in sub classes and traits. This is an affine transformation but it is not a similar transformation.

Shear 2D geometric transformation along the X Axis on a GeomElem. The return type will be narrowed in sub classes and traits. This is an affine transformation but it is not a similar transformation.

Attributes

Definition Classes
Inherited from:
AffinePreserve
override def shearY(operand: Double): ThisT

Shear 2D geometric transformation along the Y Axis on a GeomElem. The return type will be narrowed in sub classes and traits. This is an affine transformation but it is not a similar transformation.

Shear 2D geometric transformation along the Y Axis on a GeomElem. The return type will be narrowed in sub classes and traits. This is an affine transformation but it is not a similar transformation.

Attributes

Definition Classes
Inherited from:
AffinePreserve
override def show(style: ShowStyle): String

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

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

Attributes

Definition Classes
Inherited from:
ShowN
override def showDec(style: ShowStyle, maxPlaces: Int, minPlaces: Int): String

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

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

Attributes

Definition Classes
Inherited from:
ShowN
def showDec(style: ShowStyle, maxPlaces: Int): String

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

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

Attributes

Inherited from:
Show
def showElemStrDecs(way: ShowStyle, decimalPlaces: Int): StrArr

A StrArr Arr collection of the show methods return values of the elements of this Show Product class.

A StrArr Arr collection of the show methods return values of the elements of this Show Product class.

Attributes

Inherited from:
Show2

Attributes

Inherited from:
ShowN
def showSemisNameDecs(maxPlaces: Int, minPlaces: Int): String

Attributes

Inherited from:
ShowN

A StrArr Arr collection of the show methods return values of the elements of this Show Product class.

A StrArr Arr collection of the show methods return values of the elements of this Show Product class.

Attributes

Inherited from:
ShowN
override def slateXY(xDelta: Double, yDelta: Double): ThisT

Translate 2D geometric transformation, taking the xOffset and yOffset as parameters on this GeomElem returning a GeomElem. The Return type will be narrowed in sub traits. End users will often want to use the slate method taking a Pt2 or Vec2 as a parameter, the slateX or the slateY methods. These methods will be offered as extension methods using this method for their implementations.

Translate 2D geometric transformation, taking the xOffset and yOffset as parameters on this GeomElem returning a GeomElem. The Return type will be narrowed in sub traits. End users will often want to use the slate method taking a Pt2 or Vec2 as a parameter, the slateX or the slateY methods. These methods will be offered as extension methods using this method for their implementations.

Attributes

Definition Classes
Inherited from:
ProlignPreserve
override def str: String

The most basic Show method, paralleling the strT method on ShowT type class instances.

The most basic Show method, paralleling the strT method on ShowT type class instances.

Attributes

Definition Classes
Inherited from:
Show2

Show with decimal precision of 0 places.

Show with decimal precision of 0 places.

Attributes

Inherited from:
ShowDec

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.

Attributes

Inherited from:
ShowDec

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

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

Attributes

Inherited from:
ShowDec

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

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

Attributes

Inherited from:
ShowDec
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Show -> Any
Inherited from:
Show

Concrete fields

The X component of the end point of this curve segment. Often called x2 on a line or x4 on a cubic bezier in other APIs.

The X component of the end point of this curve segment. Often called x2 on a line or x4 on a cubic bezier in other APIs.

Attributes

The Y component of the end point of this curve segment. Often called y2 on a line or y4 on a cubic bezier in other APIs.

The Y component of the end point of this curve segment. Often called y2 on a line or y4 on a cubic bezier in other APIs.

Attributes

The X component of the start point of this curve segment often called x1 in other APIs.

The X component of the start point of this curve segment often called x1 in other APIs.

Attributes

The Y component of the start point of this curve segment, often called y1 in other APIs.

The Y component of the start point of this curve segment, often called y1 in other APIs.

Attributes

Implicits

Implicits

implicit override def showT1: ShowT[Pt2]

The ShowT type class instance for the 1st element of this 2 element product.

The ShowT type class instance for the 1st element of this 2 element product.

Attributes

Definition Classes
implicit override def showT2: ShowT[Pt2]

The ShowT type class instance for the 2nd element of this 2 element product.

The ShowT type class instance for the 2nd element of this 2 element product.

Attributes

Definition Classes