LoginSignup
1
0

More than 3 years have passed since last update.

一般的な方法で犬の年齢を人間換算したらそんな歳じゃないワン!!って怒られそうなので正しい年齢を算出してみた

Posted at

今までワンコの年齢を人の年齢換算するときは、犬の年齢を7倍する方法を取られていたようですが、
DNAを調べて新たに計算式が作られたようです。
https://www.akc.org/expert-advice/health/how-to-calculate-dog-years-to-human-years/

その計算機をGoで作ってみました。
ついでなので、今までの計算方法のものも作って比較してみました。

つくったやつ
https://github.com/usk81/animal-age-to-human-year

計算式の結果を表にまとめるとこんな感じです。

犬の年齢 人の年齢換算(数式) 人の年齢換算(一般的)
0 0 0
1 31 7
2 42 14
3 48 21
4 53 28
5 56 35
6 59 42
7 62 49
8 64 56
9 66 63
10 67 70
11 69 77
12 70 84
13 72 91
14 73 98
15 74 105
16 75 112
17 76 119
18 77 126
19 78 133
20 78 140

7倍してる方やばいですね、20歳になると人間超越しています。

新しい計算式の方は、1歳でもういいおっさんになってます。
31歳超えてない人は1歳以上のワンコを見たら、犬パイセンと呼ばないといけないかもしれません。
20歳はいい感じのご老人ですね。

勉強がてら、go-chartを使って年齢をプロットしてみました。
青いほうが今回の計算式のものです
output.png

go-chart
https://github.com/wcharczuk/go-chart

go-chart使い方わかると便利です。
例見てもよくわからなかったので試行錯誤が大変でしたが...

1
0
3

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