LoginSignup
2
1

More than 5 years have passed since last update.

TypeScriptでの対角線の求め方

Posted at

対角線の求め方

TypeScript

const varticalLine = 100;
const horizontalLine = 100;

const length = Math.sqrt(varticalLine ** 2 + horizontalLine ** 2);

アスタリスクでべき乗が扱えるのは便利ですね!!

参考記事

ES2016で追加された新機能Exponentiation Operatorとは一体何か? - Qiita http://qiita.com/tonkotsuboy_com/items/12436de8c6f3a289d3af

2
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
2
1