LoginSignup
1
1

More than 3 years have passed since last update.

【Python】回転行列【AtCoder】

Last updated at Posted at 2021-03-28

ABC197
D - Opposite
ででてきた、回転行列問題

今後のためにも自作ライブラリの作成。

※ちなみにこの問題は複素数平面でもとける!
知らなくても競プロで困ることはなさそうだが、教養として知っておいて良さそう。
俺の学生時代は教科書にのっていなかったけど、今や数Ⅲの範囲らしい・・・
ヨビノリたくみさんのyoutubeが参考になった。
中学数学からはじめる複素数

回転行列

test.py
import math
def RotationMatrix(before_x,before_y,d):
    d = math.radians(d)
    new_x = before_x*math.cos(d)-before_y*math.sin(d)
    new_y = before_x*math.sin(d)+before_y*math.cos(d)
    return new_x,new_y

おわり!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1