BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
I need to fill in the code at the comment in solve(). I know I will get there, it only requires the sine rule and some pythagoras, but it was a (long) while since I did any of this. I'd appreciate some help.
Given a unit square and the positions of A, B, C & D, I need to calculate the X & Y of P.
+-----------------------------------------------------------------+ | | | | A x | | x | | x | | x | | x o +C | x o | | x o | | x o | | x o | | x o | | x o | | x o | | x o | Y .......................................* P | | o . x | | o . x | | o . x | | o . x | | o . x | | o . x | | o . x | | o . x | | o . x +D | o . | | o . | | o . | B o . | | . | | . | +--------------------------------------.--------------------------+ X sub solve{ my( $a, $b, $c, $d ) = @_; my( $x, $y ); # Some trig :) return( $x, $y ); }
TIA, BrowserUk.
|
|---|