Class: Sevgi::Geometry::Triangle

Inherits:
TriangleBase
  • Object
show all
Defined in:
lib/sevgi/geometry/elements/triangle.rb

Overview

Closed three-sided element built from two adjacent segments.

Class Method Summary collapse

Class Method Details

.[](segment_a, segment_b, position: Origin) ⇒ Sevgi::Geometry::Triangle

Builds a triangle from two adjacent segments.

Parameters:

Returns:

Raises:



18
19
20
21
22
# File 'lib/sevgi/geometry/elements/triangle.rb', line 18

def self.[](segment_a, segment_b, position: Origin)
  a, b = Tuples[Segment, segment_a, segment_b]

  new_by_segments(a, b, closing_segment(a, b), position:)
end