Method: Geometry::Polyline#bisectors

Defined in:
lib/geometry/polyline.rb

#bisectorsArray<Vector>

Note:

If the Geometry::Polyline isn’t closed (the normal case), then the first and last vertices will be given bisectors that are perpendicular to themselves.

Generate the angle bisector unit vectors for each vertex

Returns:

  • (Array<Vector>)

    the unit Vectors representing the angle bisector of each vertex



136
137
138
139
# File 'lib/geometry/polyline.rb', line 136

def bisectors
    # Multiplying each bisector by the sign of k flips any bisectors that aren't pointing towards the interior of the angle
    bisector_map {|b, k| k <=> 0 }
end