Line

arcade.Line (Class)

Represents a line segment with a start and end point.

Instance Members

arcade
x1: Float

The x coordinate of the start point.


arcade
y1: Float

The y coordinate of the start point.


arcade
x2: Float

The x coordinate of the end point.


arcade
y2: Float

The y coordinate of the end point.


arcade
length(): Float

Calculates the length of the line segment.

Returns Description
Float The length of the line segment.

arcade
fromAngle(x: Float, y: Float, angle: Float, length: Float): Void

Sets this line's start and end points based on the given angle and length.

Name Type Description
x Float The x coordinate of the start point.
y Float The y coordinate of the start point.
angle Float The angle in radians.
length Float The length of the line.

arcade
new(x1: Float, y1: Float, x2: Float, y2: Float): Void

Creates a new Line instance.

Name Type Description
x1 Float The x coordinate of the start point.
y1 Float The y coordinate of the start point.
x2 Float The x coordinate of the end point.
y2 Float The y coordinate of the end point.