Class: DouglasPeucker::OrthogonalDistance

Inherits:
Struct
  • Object
show all
Defined in:
lib/douglas_peucker/orthogonal_distance.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



3
4
5
# File 'lib/douglas_peucker/orthogonal_distance.rb', line 3

def line
  @line
end

#pointObject

Returns the value of attribute point

Returns:

  • (Object)

    the current value of point



3
4
5
# File 'lib/douglas_peucker/orthogonal_distance.rb', line 3

def point
  @point
end

Instance Method Details

#distanceObject



4
5
6
# File 'lib/douglas_peucker/orthogonal_distance.rb', line 4

def distance
  numerator.abs/denominator**0.5
end