学習環境/開発環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- 数式入力ソフト(TeX, MathML): MathType
- MathML対応ブラウザ: Firefox、Safari
- MathML非対応ブラウザ(Internet Explorer, Google Chrome...)用JavaScript Library: MathJax
- OS X El Capitan - Apple (OS)
- Emacs (Text Editor)
- JavaScript (プログラミング言語)
- kjs-math-number (JavaScript Library)
- Safari(Web browser)
数学読本〈3〉平面上のベクトル/複素数と複素平面/空間図形/2次曲線/数列 (松坂 和夫(著)、岩波書店)の第10章(新しい数とその表示 - 複素数と複素平面)、10.1(複素平面)、複素数の絶対値、問2、3、4.を取り組んでみる。
問2.
2·√10√20√2=40
√5√13√2·5=√13010
問3.
|α+β|2+|α−β|2=(α+β)¯(α+β)+(α−β)¯(α−β)=(α+β)(ˉα+ˉβ)+(α−β)(ˉα−ˉβ)=αˉα+βˉβ=|α|2+|β|2問4.
|α−β|2=(α−β)¯(α−β)=(α−β)(ˉα−ˉβ)=|α|2+|β|2−2(αˉβ+ˉαβ)|1−ˉαβ|2=(1−ˉαβ)(1−αˉβ)=1+|α|2|β|2−2(αˉβ+ˉαβ)|α|=1|α|2+|β|2=1+|β|21+|α|2|β|2=1+|β|2|β|=1|α|2+|β|2=|α|2+11+|α|2|β|2=|α|2+1number.js で確認。
JavaScript
コード(Emacs)
(function () {
'use strict';
var div_output = document.querySelector('#output0'),
button_calc = document.querySelector('#calc0'),
nl = '<br>',
calc;
calc = function () {
var a,
b,
c,
d,
left,
right,
n,
one = 1,
two = 2,
output0 = '',
output1 = '';
output0 += '問2' + nl;
a = new Complex(0, -2);
b = new Complex(3, 1);
c = new Complex(2, -4);
d = new Complex(1, 1);
n = a.mul(b).mul(c).mul(d).abs();
output0 += '(1) <math><mn>' + n + '</mn></math>' + nl;
a = new Complex(-1, 2);
b = new Complex(3, -2);
c = new Complex(1, 1);
d = new Complex(3, -4);
n = a.mul(b).div(c).div(d).abs();
output1 += ' (2) <math><mn>' + n + '</mn></math>' + nl + nl;
a = new Complex(Math.floor(Math.random() * 100),
Math.floor(Math.random() * 100));
b = new Complex(Math.floor(Math.random() * 100),
Math.floor(Math.random() * 100));
left = Math.pow(a.add(b).abs(), 2);
left = left.add(Math.pow(a.sub(b).abs(), 2));
right = two.mul(Math.pow(a.abs(), 2).add(Math.pow(b.abs(), 2)));
output1 +=
'問3' + nl +
'a = ' + a + ', b = ' + b + nl +
'左辺 = 右辺: ' + left.isEqual(right) + nl +
'差: ' + left.sub(right) + nl + nl;
a = new Complex(0.6, 0.8);
b = new Complex(Math.floor(Math.random() * 100),
Math.floor(Math.random() * 100));
left = a.sub(b).abs();
right = one.sub(a.conjugate().mul(b)).abs();
output1 +=
'問4' + nl +
'a = ' + a + ', b = ' + b + nl +
'左辺 = 右辺: ' + left.isEqual(right) + nl +
'差: ' + left.sub(right) + nl + nl;
a = new Complex(Math.floor(Math.random() * 100),
Math.floor(Math.random() * 100));
b = new Complex(0.6, 0.8);
left = a.sub(b).abs();
right = one.sub(a.conjugate().mul(b)).abs();
output1 +=
'a = ' + a + ', b = ' + b + nl +
'左辺 = 右辺: ' + left.isEqual(right) + nl +
'差: ' + left.sub(right) + nl;
div_output.innerHTML = output0 + output1;
};
calc();
button_calc.onclick = calc;
}());
問2
(1) 40
(2) 1.1401754250991378
問3
a =28 + 66 i , b = 31 + 25 i
左辺 = 右辺: false
差: -1.8189894035458565e-12
問4
a =0.6 + 0.8 i , b = 62 + 56 i
左辺 = 右辺: true
差: 0
a =58 + 33 i , b = 0.6 + 0.8 i
左辺 = 右辺: true
差: 0
(1) 40
(2) 1.1401754250991378
問3
a =
左辺 = 右辺: false
差: -1.8189894035458565e-12
問4
a =
左辺 = 右辺: true
差: 0
a =
左辺 = 右辺: true
差: 0
0 コメント:
コメントを投稿