Calculation

The f subroutine calculate the complex coordinates of the the point of screen coordinates @_[0,1], and returns them.

sub f {
    ( $w / $W * ( $_[0] - ( $W - 1 ) / 2 ) * cos($A)
    + $h / $H * ( ( $H - 1 ) / 2 - $_[1] ) * sin($A) + $x,
    ( $_[0] - ( $W - 1 ) / 2 ) * -$w / $W  * sin($A)
    + $h / $H * ( ( $H - 1 ) / 2 - $_[1] ) * cos($A) + $y );
};

Proof is left as an exercise for the reader. Enjoy.

Previous | Next


Copyright © 2000-2001, Philippe "BooK" Bruhat.