https://atcoder.jp/contests/abc259/tasks/abc259_b
sin/cosは
let x = a * rad.cos() - b * rad.sin(); let y = a * rad.sin() + b * rad.cos();
こうなんですねえ。
// Counterclockwise Rotation #![allow(non_snake_case)] use std::f64::consts::PI; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok(); line.trim().parse().ok().unwrap() } fn read_vec<T: std::str::FromStr>() -> Vec<T> { read::<String>().split_whitespace() .map(|e| e.parse().ok().unwrap()).collect() } fn main() { let v = read_vec(); let a: f64 = v[0]; let b = v[1]; let d = v[2]; let rad = d * PI / 180.0; let x = a * rad.cos() - b * rad.sin(); let y = a * rad.sin() + b * rad.cos(); println!("{} {}", x, y) }