lib/plane.rb in gmath3D-0.2.3 vs lib/plane.rb in gmath3D-0.2.4
- old
+ new
@@ -3,21 +3,20 @@
module GMath3D
#
# Plane represents a infinite plane on 3D space.
#
class Plane < Geom
-public
attr_accessor:base_point
attr_accessor:normal
# [Input]
# _base_point_ and _normal_ should be Vector3.
# [Output]
# returns new instance of Plane.
def initialize(base_point = Vector3.new(), normal = Vector3.new(0,0,1))
- Util.check_arg_type(::Vector3, normal)
- Util.check_arg_type(::Vector3, base_point)
+ Util3D.check_arg_type(::Vector3, normal)
+ Util3D.check_arg_type(::Vector3, base_point)
super()
@base_point = base_point
@normal = normal.normalize()
end
@@ -68,18 +67,18 @@
return distance_to_finite_line(target)
#with Plane
elsif(target.kind_of?(Plane))
return distance_to_plane(target)
end
- Util.raise_argurment_error(target)
+ Util3D.raise_argurment_error(target)
end
# [Input]
# _target_point_ should be Vector3.
# [Output]
# retrun projected point on plane as Vector3.
def project( target_point )
- Util.check_arg_type(::Vector3, target_point)
+ Util3D.check_arg_type(::Vector3, target_point)
distance, closest_point = self.distance( target_point )
return closest_point
end
private
def distance_to_point(target_point)