;==============================================================
;!Title: VEC3 Macro Lib - Usage Example
;!Author: Gustavo J. Fiorenza (aim: gushhfx)
;!Date: 09/01/2009 - Rev: 2
;!
;==============================================================
 
CompilerIf Defined(VEC3, #PB_Constant ) = #False
	XIncludeFile "VEC3_MACRO.pbi"
CompilerEndIf
 
Define.VEC3 a, b, c
 
VEC3_SET( a, 0.1, 0.2, 0.3 )
VEC3_SET( b, 0.4, 0.5, 0.6 )
VEC3_DEBUG3( a, b, c )
 
VEC3_SUBTRACT( b, a, c )	; one vector minus the other, destination c
VEC3_DEBUG3( a, b, c )
 
VEC3_ADD( b, a, c )				; one vector plus the other, destination c
VEC3_DEBUG3( a, b, c )
 
VEC3_DEBUG( c )
VEC3_SCALE( c, 0.1, a )		; one vector multiplied by scalar, destination a
VEC3_DEBUG( a )
 
Debug ""
 
VEC3_MA( a, 10.0, b, c )	; one vector plus the other multiplied by scalar, destination c
VEC3_DEBUG3( a, b, c )
 
VEC3_NEGATE( c, a, a )		; one vector negates the other
VEC3_DEBUG( a )
 
Debug ""
 
VEC3_NORMALIZE( a )
VEC3_DEBUG( a )
 
Debug ""
 
VEC3_SET( a, 1.0, 5.0, 10.0 )
VEC3_SET( b, 10.0, 5.0, 10.0 )
 
Debug VEC3_LENGTH( b )
 
Define.f distance
VEC3_DISTANCE( a, b, distance )
 
Debug distance
Debug ""
 
VEC3_SET( a, 1.0, 5.0, 10.0 )
VEC3_SET( b, 1.0, 5.0, 10.0 )
Debug VEC3_COMPARE( a, b )
 
VEC3_SET( a, 1.1, 5.0, 10.0 )
Debug VEC3_COMPARE( a, b )
 
;....
 
 
 
; IDE Options = PureBasic 4.30 (Windows - x86)
; CursorPosition = 18
; Folding = -
; EnableCompileCount = 17
; EnableBuildCount = 0