Home Reference Source Test
import Line from 'pureimage/src/Line.js'
public class | source

Line

Create a line object represnting a set of two points in 2D space.

Line objects can be constructed by passing in either 4 numbers (startX, startY, endX, endY) - or two Point objects representing start and end respectively

Test:

Constructor Summary

Public Constructor
public

constructor(startX: number, startY: number, endX: number, endY: number)

Construct a Line using 4 numbers

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

Get the line length

Public Constructors

public constructor(startX: number, startY: number, endX: number, endY: number) source

Construct a Line using 4 numbers

Params:

NameTypeAttributeDescription
startX number

Starting position on the X axis

startY number

Starting position on the Y axis

endX number

Ending position on the X axis

endY number

Ending position on the Y acis

Test:

Public Members

public end: Point source

public start: Point source

Public Methods

public getLength(): number source

Get the line length

Return:

number