結果
| 問題 |
No.760 Where am I moved to?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-09 01:19:50 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 489 ms / 2,000 ms |
| コード長 | 765 bytes |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 46,844 KB |
| 最終ジャッジ日時 | 2024-06-26 23:00:05 |
| 合計ジャッジ時間 | 11,932 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#!/usr/bin/python
import sys,math,numpy
def thirdPoint(a):
xdiff=a[1][0]-a[0][0]
ydiff=a[1][1]-a[0][1]
return [a[1][0]-ydiff,a[1][1]+xdiff]
xa,ya,ta=map(float,sys.stdin.readline().split())
ta*=math.pi/180
before_=[]
for _ in range(2): before_.append(list(map(float,sys.stdin.readline().split()))+[1])
before_.append(thirdPoint(before_)+[1])
before=numpy.array(before_).transpose()
after_=[]
for _ in range(2): after_.append(list(map(float,sys.stdin.readline().split()))+[1])
after_.append(thirdPoint(after_)+[1])
after=numpy.array(after_).transpose()
r=before.dot(numpy.linalg.inv(after)).dot([[math.cos(ta),-math.sin(ta),xa],[math.sin(ta),math.cos(ta),ya],[0,0,1]])
print(' '.join('%.12f'%e for e in [r[0][2],r[1][2],math.atan2(r[1][0],r[0][0])*180/math.pi]))