/** * Axiom: A⋅A⊥ = -A⊥⋅A * Swapping operands changes the sign of the perp dot product * @dataProvider dataProviderForPerpendicularIdentity */ public function testPerpDotProdcutSwapOperandsChangeSign(array $A) { $A = new Vector($A); $A⊥ = $A->perpendicular(); $A⋅A⊥ = $A->dotProduct($A⊥); $A⊥⋅A = $A⊥->dotProduct($A); $this->assertEquals($A⋅A⊥, -$A⊥⋅A); }
public function testPerpendicularExceptionNGreaterThanTwo() { $A = new Vector([1, 2, 3]); $this->setExpectedException('MathPHP\\Exception\\VectorException'); $A->perpendicular(); }