Class: AIXM::Component::Geometry::Arc
- Defined in:
- lib/aixm/component/geometry/arc.rb
Overview
Arcs are clockwise or counter clockwise circle segments around a #center_xy and starting at Point#xy.
Cheat Sheet in Pseudo Code:
arc = AIXM.arc(
xy: AIXM.xy
center_xy: AIXM.xy
clockwise: true or false
)
Instance Attribute Summary collapse
-
#center_xy ⇒ Object
Center point.
-
#clockwise ⇒ Object
Whether the arc is going clockwise.
Attributes inherited from Point
Instance Method Summary collapse
-
#clockwise? ⇒ Object
Whether the arc is going clockwise.
-
#initialize(xy:, center_xy:, clockwise:) ⇒ Arc
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
Methods inherited from Point
Methods included from AIXM::Concerns::XMLBuilder
#build_fragment, #to_uid, #to_xml
Methods included from AIXM::Concerns::Memoize
Methods included from AIXM::Concerns::Association
Constructor Details
#initialize(xy:, center_xy:, clockwise:) ⇒ Arc
See the cheat sheet for examples on how to create instances of this class.
30 31 32 33 |
# File 'lib/aixm/component/geometry/arc.rb', line 30 def initialize(xy:, center_xy:, clockwise:) super(xy: xy) self.center_xy, self.clockwise = center_xy, clockwise end |
Instance Attribute Details
#center_xy ⇒ AIXM::XY #center_xy=(value) ⇒ Object
Center point
26 27 28 |
# File 'lib/aixm/component/geometry/arc.rb', line 26 def center_xy @center_xy end |
#clockwise? ⇒ Boolean #clockwise=(value) ⇒ Object
Whether the arc is going clockwise
52 53 54 |
# File 'lib/aixm/component/geometry/arc.rb', line 52 def clockwise? @clockwise end |
Instance Method Details
#clockwise? ⇒ Boolean #clockwise=(value) ⇒ Object
Whether the arc is going clockwise
52 53 54 |
# File 'lib/aixm/component/geometry/arc.rb', line 52 def clockwise? @clockwise end |
#inspect ⇒ String
36 37 38 |
# File 'lib/aixm/component/geometry/arc.rb', line 36 def inspect %Q(#<#{self.class} xy="#{xy}" center_xy="#{center_xy}" clockwise=#{clockwise}>) end |