P
P
plpm2018-11-30 10:17:47
Perl
plpm, 2018-11-30 10:17:47

Wrong coordinates or/and formula?

There is an array with coordinates.
I use this code

$rad = 45 * (pi / 180);
    $c = 2; # центр xy

    # цикл

    $nx = $c + ($x - $c) * cos($rad) + ($y - $c) * sin($rad);
    $ny = $c - ($x - $c) * sin($rad) + ($y - $c) * cos($rad);

but such data is returned, shown in the table:
5c00e38ab5f2d458309204.png
what is the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
plpm, 2018-12-05
@plpm

solution https://stackoverflow.com/a/29983827

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question