1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

JS/TSで~度(度数法)を~ラジアン(弧度法)に変える方法

Posted at

はじめに

JS/TSでかんたんなゲームを作っていたときに角度計算の度に 度数法 -> 弧度法 の計算をしているのに気が付き
気持ち悪くなったので、自分への戒め的な感じで記事にしておく。

toRad.js
const toRadians = (angle) => (angle * Math.PI) / 180;
toRad.ts
const toRadians = (angle: number): number => (angle * Math.PI) / 180;
1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?