EasyGeometry::D2::Segment

A segment in a 2-dimensional Euclidean space. Segment inherit from Linear Entity.

#contains?(entity)

Is other GeometryEntity contained in this Segment?

Returns:

  • true if entity is in this Segment.

  • false otherwise.

#==(other)

Returns True if self and otherare the same mathematical entities.

#distance(point)

Finds the shortest distance between a line segment and a point.

#length

The length of the line segment.

#midpoint

The midpoint of the line segment.

#perpendicular_bisector(point=nil)

The perpendicular bisector of this segment.

If no point is specified or the point specified is not on the bisector then the bisector is returned as a Line.

Otherwise a Segment is returned that joins the point specified and the intersection of the bisector and the segment.

Last updated

Was this helpful?