Class: Geom::Plane
- Inherits:
-
Object
- Object
- Geom::Plane
- Defined in:
- lib/geom/plane.rb
Instance Attribute Summary collapse
-
#normal ⇒ Object
Returns the value of attribute normal.
Class Method Summary collapse
Instance Method Summary collapse
- #distance(point) ⇒ Object
-
#initialize(normal = nil, point = nil) ⇒ Plane
constructor
A new instance of Plane.
- #set_three_points(p0, p1, p2) ⇒ Object
Constructor Details
Instance Attribute Details
#normal ⇒ Object
Returns the value of attribute normal.
3 4 5 |
# File 'lib/geom/plane.rb', line 3 def normal @normal end |
Class Method Details
.three_points(p0, p1, p2) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/geom/plane.rb', line 14 def self.three_points(p0,p1,p2) plane = Plane.new n0 = p0.instance_of?(Number3D) ? p0 : p0.position n1 = p1.instance_of?(Number3D) ? p1 : p1.position n2 = p2.instance_of?(Number3D) ? p2 : p2.position plane.set_three_points(n0,n1,n2) plane end |