Processing math: 100%

2016年9月1日木曜日

学習環境/開発環境

数学読本〈3〉平面上のベクトル/複素数と複素平面/空間図形/2次曲線/数列 (松坂 和夫(著)、岩波書店)の第10章(新しい数とその表示 - 複素数と複素平面)、10.1(複素平面)、複素数の絶対値、問2、3、4.を取り組んでみる。

問2.


  1. 2·10202=40

  2. 5132·5=13010

問3.

|α+β|2+|αβ|2=(α+β)¯(α+β)+(αβ)¯(αβ)=(α+β)(ˉα+ˉβ)+(αβ)(ˉαˉβ)=αˉα+βˉβ=|α|2+|β|2

問4.

|αβ|2=(αβ)¯(αβ)=(αβ)(ˉαˉβ)=|α|2+|β|22(αˉβ+ˉαβ)|1ˉαβ|2=(1ˉαβ)(1αˉβ)=1+|α|2|β|22(αˉβ+ˉαβ)|α|=1|α|2+|β|2=1+|β|21+|α|2|β|2=1+|β|2|β|=1|α|2+|β|2=|α|2+11+|α|2|β|2=|α|2+1

number.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+66i, b = 31+25i
左辺 = 右辺: false
差: -1.8189894035458565e-12

問4
a = 0.6+0.8i, b = 62+56i
左辺 = 右辺: true
差: 0

a = 58+33i, b = 0.6+0.8i
左辺 = 右辺: true
差: 0

0 コメント:

コメントを投稿