Class: Sumi::Geometry::Element::Arced
- Inherits:
-
Sumi::Geometry::Element
- Object
- Sumi::Geometry::Element
- Sumi::Geometry::Element::Arced
- Defined in:
- geometry/lib/sumi/geometry/element/arced.rb
Overview
Abstract family of circular and elliptical boundary elements. Arc is open, while Ellipse and Circle have closed boundaries. Concrete values share exact and precision-aware comparisons.
Direct Known Subclasses
Instance Method Summary collapse
-
#eq?(other, precision: nil) ⇒ Boolean
Compares canonical fields with coordinate and numeric precision.
-
#eql?(other) ⇒ Boolean
(also: #==)
Reports strict equality by concrete class and canonical fields.
-
#hash ⇒ Integer
Returns a hash independent of numeric precision.
-
#outside?(point) ⇒ Boolean
Reports whether a point is outside the element.
Methods inherited from Sumi::Geometry::Element
#at, #box, #closed?, #equations, #ignorable?, #intersection, lined, #position, #translate
Instance Method Details
#eq?(other, precision: nil) ⇒ Boolean
Compares canonical fields with coordinate and numeric precision.
13 14 15 16 17 18 |
# File 'geometry/lib/sumi/geometry/element/arced.rb', line 13 def eq?(other, precision: nil) other.instance_of?(self.class) && state.zip(other.send(:state)).all? do |left, right| left.is_a?(::Numeric) ? F.eq?(left, right, precision:) : left.eq?(right, precision:) end end |
#eql?(other) ⇒ Boolean Also known as: ==
Reports strict equality by concrete class and canonical fields.
23 |
# File 'geometry/lib/sumi/geometry/element/arced.rb', line 23 def eql?(other) = other.instance_of?(self.class) && state == other.send(:state) |
#hash ⇒ Integer
Returns a hash independent of numeric precision.
27 |
# File 'geometry/lib/sumi/geometry/element/arced.rb', line 27 def hash = [self.class, *state].hash |
#outside?(point) ⇒ Boolean
Reports whether a point is outside the element.
33 |
# File 'geometry/lib/sumi/geometry/element/arced.rb', line 33 def outside?(point) = !inside?(point) |