EasyGeometry::D2::Ray

A Ray is a semi-line in the space with a source point and a direction. Segment inherit from Linear Entity.

#contains?(entity)

Is other GeometryEntity contained in this Ray?

Returns:

  • true if entity is in this Ray.

  • false otherwise.

#distance(point)

Finds the shortest distance between the ray and a point.

#==(other)

Returns True if self and otherare the same mathematical entities.

#source

The point from which the ray emanates.

#xdirection

The x direction of the ray.

Returns:

  • Positive infinity if the ray points in the positive x direction

  • Negative infinity if the ray points in the negative x direction

  • 0 if the ray is vertical

#ydirection

The y direction of the ray.

Returns:

  • Positive infinity if the ray points in the positive y direction

  • Negative infinity if the ray points in the negative y direction

  • 0 if the ray is horizontal

Last updated

Was this helpful?