API Docs for: 1.2.2
Show:

Kiwi.Geom.Ray Class

Defined in: src/geom/Ray.ts:9
Module: Geom
Parent Module: Kiwi

Represents a halfline. The ray starts at the first point and extends infinitely in the direction of the second.

Constructor

Kiwi.Geom.Ray

(
  • [x1=0]
  • [y1=0]
  • [x2=0]
  • [y2=0]
)
Kiwi.Geom.Ray

Defined in src/geom/Ray.ts:9

Parameters:

  • [x1=0] Number optional

    Starting location of the ray on the x-axis.

  • [y1=0] Number optional

    Starting location of the ray on the y-axis.

  • [x2=0] Number optional

    End location of the ray on the x-axis. Used to calculate direction so it isn't really the 'end' location.

  • [y2=0] Number optional

    End location of the ray on the y-axis. Used to calculate direction so it isn't really the 'end' location.

Returns:

Kiwi.Geom.Ray:

This Object

Methods

clone

(
  • [output]
)
Kiwi.Geom.Ray public

Defined in src/geom/Ray.ts:75

Makes a copy of this Ray either as a new Ray object or, makes a passed Ray a copy of this one.

Parameters:

Returns:

copyFrom

(
  • source
)
Kiwi.Geom.Ray public

Defined in src/geom/Ray.ts:90

Makes this Ray the same as a passed Ray.

Parameters:

Returns:

copyTo

(
  • target
)
Kiwi.Geom.Ray public

Defined in src/geom/Ray.ts:103

Makes a passed Ray the same as this Ray object.

Parameters:

Returns:

isPointOnRay

(
  • x
  • y
)
Boolean public

Defined in src/geom/Ray.ts:176

Check if the Ray passes through a point.

Parameters:

  • x Number
  • y Number

Returns:

Boolean:

objType

() String public

Defined in src/geom/Ray.ts:29

The type of this object.

Returns:

String:

"Ray"

setTo

(
  • [x1=0]
  • [y1=0]
  • [x2=0]
  • [y2=0]
)
Kiwi.Geom.Ray public

Defined in src/geom/Ray.ts:116

Sets the origin and the direction of this Ray.

Parameters:

  • [x1=0] Number optional
  • [y1=0] Number optional
  • [x2=0] Number optional
  • [y2=0] Number optional

Returns:

toString

() String public

Defined in src/geom/Ray.ts:197

Get a string representation of the ray.

Returns:

String:

Properties

angle

Number public

Defined in src/geom/Ray.ts:137

Get the angle of the ray.

slope

Number public

Defined in src/geom/Ray.ts:150

Get the slope of the ray.

x1

Number public

Defined in src/geom/Ray.ts:39

The x component of the initial point of the ray

Default: 0

x2

Number public

Defined in src/geom/Ray.ts:57

The x component of the direction point of the ray

Default: 0

y1

Number public

Defined in src/geom/Ray.ts:48

The y component of the initial point of the ray

Default: 0

y2

Number public

Defined in src/geom/Ray.ts:66

The y component of the direction point of the ray

Default: 0

yIntercept

Number public

Defined in src/geom/Ray.ts:163