Home Reference Source Test Repository
public class | source

Line2D

Class representing 2D lines. Container for a pair of 2D points and some helper functions.

Test:

Constructor Summary

Public Constructor
public

Constructs a Line2D object.

Member Summary

Public Members
public

a: *

public

b: *

Method Summary

Public Methods
public

Checks if the given point is on the line.

Public Constructors

public constructor(a: Point2D, b: Point2D) source

Constructs a Line2D object.

Params:

NameTypeAttributeDescription
a Point2D

First point of the line.

b Point2D

Second point of the line.

Test:

Public Members

public a: * source

public b: * source

Public Methods

public hasPoint(c: Point2D): boolean source

Checks if the given point is on the line.

Params:

NameTypeAttributeDescription
c Point2D

The point to check.

Return:

boolean

Whether or not the given point is on the line.

Test: