Index: Include/abgl.ab
===================================================================
--- Include/abgl.ab	(revision 67)
+++ Include/abgl.ab	(revision 72)
@@ -144,6 +144,6 @@
 /*	Function Operator * (vec1 As Vector2d, vec2 As Vector2d) As Vector2d
 		Return Dot(vec1,vec2)
-	End Function
-*/
+	End Function*/
+
 	Function Operator * (vec As Vector2d, sca As GLfloat) As Vector2d
 		Dim ret As Vector2d(vec.X*sca,vec.Y*sca)
@@ -161,14 +161,14 @@
 		Return ret
 	End Function
-	Function Distance(vec1 As Vector2d, vec2 As Vector2d) As GLfloat
+	Function Distance(vec1 As Vector2d, vec2 As Vector2d) As GLdouble
 		Dim ret As Vector2d
 		ret=vec1-vec2
 		Return ret.Magnitude
 	End Function
-	Function Dot(vec1 As Vector2d, vec2 As Vector2d) As GLfloat
+	Function Dot(vec1 As Vector2d, vec2 As Vector2d) As GLdouble
 		Return vec1.X*vec2.X+vec1.Y*vec2.Y
 	End Function
-	Function Magnitude() As GLfloat
-		Return Math.Sqrt(This.X^2+This.Y^2) As GLfloat
+	Function Magnitude() As GLdouble
+		Return Math.Sqrt(This.X^2+This.Y^2) As GLdouble
 	End Function
 	Sub Normalize()
@@ -242,4 +242,73 @@
 	End Sub
 
+Public /* operator */
+	Sub Operator = (vec As Vector3f)
+		This.X=vec.X
+		This.Y=vec.Y
+	End Sub
+	Function Operator + (vec1 As Vector3f, vec2 As Vector3f) As Vector3f
+		Return Add(vec1,vec2)
+	End Function
+	Function Operator - (vec1 As Vector3f, vec2 As Vector3f) As Vector3f
+		Return Substract(vec1,vec2)
+	End Function
+/*	Function Operator * (vec1 As Vector3f, vec2 As Vector3f) As Vector3f
+		Return Dot(vec1,vec2)
+	End Function*/
+	Function Operator ^ (vec1 As Vector3f, vec2 As Vector3f) As Vector3f
+		Return Cross(vec1,vec2)
+	End Function
+
+	Function Operator * (vec As Vector3f, sca As GLfloat) As Vector3f
+		Dim ret As Vector3f(vec.X*sca,vec.Y*sca)
+		Return ret
+	End Function
+	Function Operator / (vec As Vector3f, sca As GLfloat) As Vector3f
+		Dim ret As Vector3f(vec.X/sca,vec.Y/sca)
+		Return ret
+	End Function
+
+
+Public /* method */
+	Function Add(vec1 As Vector3f, vec2 As Vector3f) As Vector3f
+		Dim ret As Vector3f(vec1.X+vec2.X,vec1.Y+vec2.Y,vec1.Z-vec2.Z)
+		Return ret
+	End Function
+	Function Cross(vec1 As Vector3f, vec2 As Vector3f) As Vector3f
+		Dim ret As Vector3f(vec1.Y*vec2.Z-vec1.Z*vec2.Y,vec1.Z*vec2.X-vec1.X*vec2.Z,vec1.X*vec2.Y-vec1.Y*vec2.X)
+		Return ret
+	End Function
+	Function Distance(vec1 As Vector3f, vec2 As Vector3f) As GLfloat
+		Dim ret As Vector3f
+		ret=vec1-vec2
+		Return ret.Magnitude
+	End Function
+	Function Dot(vec1 As Vector3f, vec2 As Vector3f) As GLfloat
+		Return vec1.X*vec2.X+vec1.Y*vec2.Y+vec1.Z*vec2.Z
+	End Function
+	Function Magnitude() As GLfloat
+		Return Math.Sqrt(This.X^2+This.Y^2+This.Z^2) As GLfloat
+	End Function
+	Sub Normalize()
+		Dim ret As Vector3f(This.X/This.Magnitude,This.Y/This.Magnitude,This.Z/This.Magnitude)
+		This = ret
+	End Sub
+	Function NormalizedVector() As Vector3f
+		Dim ret As Vector3f(This.X/This.Magnitude,This.Y/This.Magnitude,This.Z/This.Magnitude)
+		Return ret
+	End Function
+	Function Substract(vec1 As Vector3f, vec2 As Vector3f) As Vector3f
+		Dim ret As Vector3f(vec1.X-vec2.X,vec1.Y-vec2.Y,vec1.Z-vec2.Z)
+		Return ret
+	End Function
+	Sub Reverse()
+		Dim ret As Vector3f(-This.X,-This.Y,-This.Z)
+		This = ret
+	End Sub
+	Function ReversedVector() As Vector3f
+		Dim ret As Vector3f(-This.X,-This.Y,-This.Z)
+		Return ret
+	End Function
+
 Protected
 	xyz As XYZ_FLOAT
@@ -258,4 +327,5 @@
 	End Sub
 
+
 Public /* property */
 	Function X() As GLdouble
@@ -277,4 +347,75 @@
 		xyz.z=z
 	End Sub
+
+
+Public /* operator */
+	Sub Operator = (vec As Vector3d)
+		This.X=vec.X
+		This.Y=vec.Y
+	End Sub
+	Function Operator + (vec1 As Vector3d, vec2 As Vector3d) As Vector3d
+		Return Add(vec1,vec2)
+	End Function
+	Function Operator - (vec1 As Vector3d, vec2 As Vector3d) As Vector3d
+		Return Substract(vec1,vec2)
+	End Function
+/*	Function Operator * (vec1 As Vector3d, vec2 As Vector3d) As Vector3d
+		Return Dot(vec1,vec2)
+	End Function*/
+	Function Operator ^ (vec1 As Vector3d, vec2 As Vector3d) As Vector3d
+		Return Cross(vec1,vec2)
+	End Function
+
+	Function Operator * (vec As Vector3d, sca As GLdouble) As Vector3d
+		Dim ret As Vector3d(vec.X*sca,vec.Y*sca)
+		Return ret
+	End Function
+	Function Operator / (vec As Vector3d, sca As GLdouble) As Vector3d
+		Dim ret As Vector3d(vec.X/sca,vec.Y/sca)
+		Return ret
+	End Function
+
+
+Public /* method */
+	Function Add(vec1 As Vector3d, vec2 As Vector3d) As Vector3d
+		Dim ret As Vector3d(vec1.X+vec2.X,vec1.Y+vec2.Y,vec1.Z-vec2.Z)
+		Return ret
+	End Function
+	Function Cross(vec1 As Vector3d, vec2 As Vector3d) As Vector3d
+		Dim ret As Vector3d(vec1.Y*vec2.Z-vec1.Z*vec2.Y,vec1.Z*vec2.X-vec1.X*vec2.Z,vec1.X*vec2.Y-vec1.Y*vec2.X)
+		Return ret
+	End Function
+	Function Distance(vec1 As Vector3d, vec2 As Vector3d) As GLdouble
+		Dim ret As Vector3d
+		ret=vec1-vec2
+		Return ret.Magnitude
+	End Function
+	Function Dot(vec1 As Vector3d, vec2 As Vector3d) As GLdouble
+		Return vec1.X*vec2.X+vec1.Y*vec2.Y+vec1.Z*vec2.Z
+	End Function
+	Function Magnitude() As GLdouble
+		Return Math.Sqrt(This.X^2+This.Y^2+This.Z^2) As GLdouble
+	End Function
+	Sub Normalize()
+		Dim ret As Vector3d(This.X/This.Magnitude,This.Y/This.Magnitude,This.Z/This.Magnitude)
+		This = ret
+	End Sub
+	Function NormalizedVector() As Vector3d
+		Dim ret As Vector3d(This.X/This.Magnitude,This.Y/This.Magnitude,This.Z/This.Magnitude)
+		Return ret
+	End Function
+	Function Substract(vec1 As Vector3d, vec2 As Vector3d) As Vector3d
+		Dim ret As Vector3d(vec1.X-vec2.X,vec1.Y-vec2.Y,vec1.Z-vec2.Z)
+		Return ret
+	End Function
+	Sub Reverse()
+		Dim ret As Vector3d(-This.X,-This.Y,-This.Z)
+		This = ret
+	End Sub
+	Function ReversedVector() As Vector3d
+		Dim ret As Vector3d(-This.X,-This.Y,-This.Z)
+		Return ret
+	End Function
+
 
 Protected
@@ -327,4 +468,36 @@
 	End Sub
 
+Public /* operator */
+
+	' HSBを求める式はhttp://ofo.jp/osakana/cgtips/hsb.phtmlを参考にした
+	' Drawwing\Color.abをさらに参考にしました。
+	Function GetHue() As GLfloat
+		Dim max As GLfloat, min As GLfloat, d As GLfloat
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		min = Math.Min(Math.Min(rgb.r, rgb.g), rgb.b)
+		d = max - min
+		If rgb.g = max Then
+			Return ((rgb.b - rgb.r) As Double / d * 1.0*_System_PI/3.0 + 2.0*_System_PI/3.0) As GLfloat
+		ElseIf rgb.b = max Then
+			Return ((rgb.r - rgb.g) As Double / d * 1.0*_System_PI/3.0 + 4.0*_System_PI/3.0) As GLfloat
+		ElseIf rgb.g < rgb.b Then
+			Return ((rgb.g - rgb.b) As Double / d * 1.0*_System_PI/3.0 + 6.0*_System_PI/3.0) As GLfloat
+		Else
+			Return ((rgb.g - rgb.b) As Double / d * 1.0*_System_PI/3.0) As GLfloat
+		EndIf
+	End Function
+
+	Function GetSaturation() As GLfloat
+		Dim max As GLfloat, min As GLfloat
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		min = Math.Min(Math.Min(rgb.r, rgb.g), rgb.b)
+		Return (max - min) / max
+	End Function
+
+	Function GetBrightness() As GLfloat
+		Dim max As GLfloat
+		max = Math.Max(Math.Max(rgb.r, rgb.g), rgb.b)
+		Return max
+	End Function
 Protected
 	rgb As RGB_FLOAT
