0
1

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 5 years have passed since last update.

正規化された数字(0 ~ 1)を -1 ~ 1に変換する

Posted at

色々な値を正規化することがあります。
正規化した値をケースによっては -1 ~ 1にしたいことがあるんですが
その度にすぐ出てこず忘れてしまうので備忘録として残しておきます。

var val = (normalize - 0.5) * 2;

var normalize = 0.4; //0 ~ 1
var val = (normalize - 0.5) * 2; // -1 ~ 1
consoloe.log(val); // -0.2
0
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?