View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}
{zone-data:component-name}
Zend_Math
{zone-data}

{zone-data:proposer-list}
[~walter.tamboer]
{zone-data}

{zone-data:liaison}
[~freak]
{zone-data}

{zone-data:revision}
2.0 - 02 Jun 2011: Finished the proposal code so that it can be reviewed.
1.0 - 29 May 2011: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Math is a component which contains math related functions and classes. The purpose of this component is to make life easier for people who are doing vector and matrix math for example.
{zone-data}

{zone-data:references}
* http://en.wikipedia.org/wiki/Mathematics
* http://en.wikipedia.org/wiki/Euclidean_vector
* http://en.wikipedia.org/wiki/Matrix_(mathematics)
* http://www.math.com

{zone-data}

{zone-data:requirements}
* This component *will* support helper methods such as "clamp" and "lerp".
* This component *will* support vector classes to do vector math.
* This component *will* support matrix classes to do matrix math.
* This component *will* support functionality to detect intersections.
{zone-data}

{zone-data:dependencies}
* Zend_Exception
* SPL Iterator
* SPL Exceptions
{zone-data}

{zone-data:operation}
This component can be used as is. It can be used to do calculations.
{zone-data}

{zone-data:milestones}
* Milestone 1: Setup the proposal and consider feedback.
* Milestone 2: Write and finish component source code.
* Milestone 3: Write unit tests
* Milestone 4: Write documentation
{zone-data}

{zone-data:class-list}
* Zend_Math
* Zend_Math_BoundingBox
* Zend_Math_BoundingFrustum
* Zend_Math_BoundingSphere
* Zend_Math_BoundingVolume
* Zend_Math_Exception
* Zend_Math_Exception_DivideByZero
* Zend_Math_Interface
* Zend_Math_Matrix
* Zend_Math_Matrix_Matrix44
* Zend_Math_Plane
* Zend_Math_Point
* Zend_Math_Quaternion
* Zend_Math_Ray
* Zend_Math_Rectangle
* Zend_Math_Size
* Zend_Math_Vector
* Zend_Math_Vector_Vector2
* Zend_Math_Vector_Vector3
* Zend_Math_Vector_Vector4
{zone-data}

{zone-data:use-cases}
||UC-01||
{code}
<?php

// Calculate the cross product of two vectors:
$locationOne = Zend_Math_Vector_Vector3::getUnitY();
$locationTwo = new Zend_Math_Vector_Vector3( -1.0, 0.0, 0.0 );
$crossProduct = $locationOne->cross( $locationTwo );
{code}

||UC-02||
{code}
<?php

// Create a translation, rotation and scaling matrix:
$translation = Zend_Math_Matrix_Matrix44::createTranslation( 12.34, 56.78, 90 );
$rotation = Zend_Math_Matrix_Matrix44::createRotationX( Zend_Math::degToRad( 90 ) );
$scale = Zend_Math_Matrix_Matrix44::createScale( 1, 1, 1 );

// Create a transformation matrix:
$transform = $scale->mul( $rotation )->mul( $translation );
{code}
{zone-data}

{zone-data:skeletons}

The code for this proposal can be found at [http://code.google.com/p/zend-math/source/browse/]

{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>