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], LineLike, CurveSeg, Tell2[Pt2, Pt2], AffinePreserve, BoundedElem

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 BoundedElem
trait Tell2[Pt2, Pt2]
trait Persist2[Pt2, Pt2]
trait Tell2Plused[Pt2, Pt2]
trait Persist2Plus[Pt2, Pt2]
trait Persist1Plus[Pt2]
trait PersistN
trait TellN
trait Tell
trait Persist
trait CurveSeg
trait Drawable
trait LineLike
trait GeomElem
trait Dbl4Elem
trait DblNElem
trait LineSegLike[Pt2]
trait ValueNElem
trait SpecialT
class Object
trait Matchable
class Any
Show all

Members list

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

def angle: Angle

The angle of this line segment.

The angle of this line segment.

Attributes

override def boundingRect: Rect

The bounding Rectangle provides an initial exclusion test as to whether the pointer is inside the polygon / shape

The bounding Rectangle provides an initial exclusion test as to whether the pointer is inside the polygon / shape

Attributes

Definition Classes
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(lineWidth: Double, lineColour: Colour): LineSegDraw

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

Draws this geometric element to produce a GraphElem graphical element, that 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 fractionalPoint(fraction: Double): Pt2

Returns a point part way along this LinsSeg expects a Double of range 0 => 1.

Returns a point part way along this LinsSeg expects a Double of range 0 => 1.

Attributes

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

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 length: Double
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

def revVec: Vec2

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

def right90: Angle

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

def startPt: Pt2

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 tell1: Pt2

Element 1 of this Tell2+ element product.

Element 1 of this Tell2+ element product.

Attributes

Definition Classes
override def tell2: Pt2

Element 2 of this Tell2+ element product.

Element 2 of this Tell2+ element product.

Attributes

Definition Classes
override def tellDepth: Int

The syntactic depth of the tell String for this object.

The syntactic depth of the tell String for this object.

Attributes

Definition Classes
Tell2 -> Tell
override def typeStr: String

The type of the object to be persisted.

The type of the object to be persisted.

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): RArr[GraphicSvgElem]

Inherited methods

Attributes

Inherited from:
BoundedElem
final def boundCen: Pt2

The centre of the bounding rectangle. consider also using cenDefault.

The centre of the bounding rectangle. consider also using cenDefault.

Attributes

Inherited from:
BoundedElem

Attributes

Inherited from:
BoundedElem

The height of the BoundingRect of this object.

The height of the BoundingRect of this object.

Attributes

Inherited from:
BoundedElem

The width of the BoundingRect of this object.

The width of the BoundingRect of this object.

Attributes

Inherited from:
BoundedElem

Attributes

Inherited from:
BoundedElem

If the geometric element has a defined centre then the cenDefault uses that, else it defaults to the centre of the bounding rectangle.

If the geometric element has a defined centre then the cenDefault uses that, else it defaults to the centre of the bounding rectangle.

Attributes

Inherited from:
BoundedElem
override def dblBufferAppend(buffer: ArrayBuffer[Double]): Unit

Utility method to append this as an element to an ArrayBuffer[Double]. End users should rarely need to use this method.

Utility method to append this as an element to an ArrayBuffer[Double]. End users should rarely need to use this method.

Attributes

Definition Classes
Inherited from:
Dbl4Elem
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:
Tell2
def el2Show(style: ShowStyle, maxPlaces: Int): String

Attributes

Inherited from:
Tell2

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:
Tell2
def fillOrDraw(lineWidth: Double, colour: Colour): GraphicElem

If this element is Fillable applies the fill method, ignoring the line width parameter, else applies the draws method.

If this element is Fillable applies the fill method, ignoring the line width parameter, else applies the draws method.

Attributes

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

Transforms this LineSegLike into a LineSegLike of type LB, by mapping the vertices to vertices of type VB.

Transforms this LineSegLike into a LineSegLike of type LB, by mapping the vertices to vertices of type VB.

Attributes

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

Optionally Transforms this LineSegLike into a LineSegLike of type LB, by mapping the vertices to vertices of type VB, as long as both vertices map to a Some result.

Optionally Transforms this LineSegLike into a LineSegLike of type LB, by mapping the vertices to vertices of type VB, as long as both vertices map to a Some result.

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:
Persist2
override def opt1: Option[Pt2]

The optional default value for parameter 1.

The optional default value for parameter 1.

Attributes

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

The optional default value for parameter 2.

The optional default value for parameter 2.

Attributes

Definition Classes
Inherited from:
Tell2Plused
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:
Tell2
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 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
TellN -> Tell
Inherited from:
TellN
def str0: String

Show with decimal precision of 0 places.

Show with decimal precision of 0 places.

Attributes

Inherited from:
Tell
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.

Attributes

Inherited from:
Tell
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.

Attributes

Inherited from:
Tell
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.

Attributes

Inherited from:
Tell
override def tell(style: ShowStyle, maxPlaces: Int, minPlaces: Int): String

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

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

Attributes

Definition Classes
TellN -> Tell
Inherited from:
TellN
override def tellElemStrs(way: ShowStyle, decimalPlaces: Int, minPlaces: 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

Definition Classes
Inherited from:
Tell2
def tellSemisNames(maxPlaces: Int, minPlaces: Int): String

Attributes

Inherited from:
TellN

Attributes

Inherited from:
BoundedElem
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
Tell -> Any
Inherited from:
Tell

This property determines if the type can be used with Multiple syntax.

This property determines if the type can be used with Multiple syntax.

MyObj * 7

. for describing sequences succinctly. This is not desirable for some types such as numerical and mathematical vector types as this could be confusing 3 * 4 should resolve to an Int of value 12, not a Multiple(3, 4).

Attributes

Inherited from:
Persist

Concrete fields

val endX: Double

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

val endY: Double

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

val startX: Double

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

val startY: Double

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 show1: Show[Pt2]

Attributes

Definition Classes
implicit override def show2: Show[Pt2]

Attributes

Definition Classes