Class: Sevgi::Geometry::Line
- Inherits:
-
Object
- Object
- Sevgi::Geometry::Line
- Extended by:
- Forwardable
- Defined in:
- lib/sevgi/geometry/equation.rb,
lib/sevgi/geometry/elements/line.rb
Class Method Summary collapse
Instance Method Summary collapse
- #draw!(node) ⇒ Object
- #equation ⇒ Object
-
#over?(point) ⇒ Boolean
TODO: xxx.
- #shift(distance) ⇒ Object
Class Method Details
Instance Method Details
#draw!(node) ⇒ Object
22 |
# File 'lib/sevgi/geometry/elements/line.rb', line 22 def draw!(node, **) = node.Cline(x1: position.x, y1: position.y, x2: ending.x, y2: ending.y, **) |
#equation ⇒ Object
67 |
# File 'lib/sevgi/geometry/equation.rb', line 67 def equation = position.equation(angle) |
#over?(point) ⇒ Boolean
TODO: xxx
25 |
# File 'lib/sevgi/geometry/elements/line.rb', line 25 def over?(point) = within_range?(point) && equation.on?(point) |
#shift(distance) ⇒ Object
27 |
# File 'lib/sevgi/geometry/elements/line.rb', line 27 def shift(distance) = translate(distance * F.sin(angle), distance * F.cos(angle)) |