Processing math: 100%

媒介変数表示とグラフ

リサージュ曲線

次のような媒介変数表示される曲線をリサージュ曲線といいます。

{x=sinaty=sinbt

a = 1, b = 2

import java.awt.Graphics2D;

import myMath.MyCurve;
import myMath.Tpl20;

public class TestMyParameter071 extends Tpl20 {

	public void draw2(Graphics2D g2) {
		MyPara1 pf = new MyPara1();

		draw(pf, 0, 2 * Math.PI);
	}

	class MyPara1 extends MyCurve {
		double a = 1;
		double b = 2;

		public void p(double t) {
			x = Math.sin(a * t);
			y = Math.sin(b * t);
		}
	}
}

a = 2, b = 3

import java.awt.Graphics2D;

import myMath.MyCurve;
import myMath.Tpl20;

public class TestMyParameter072 extends Tpl20 {

	public void draw2(Graphics2D g2) {
		MyPara1 pf = new MyPara1();

		draw(pf, 0, 2 * Math.PI);
	}

	class MyPara1 extends MyCurve {
		double a = 2;
		double b = 3;

		public void p(double t) {
			x = Math.sin(a * t);
			y = Math.sin(b * t);
		}
	}
}

a = 4, b = 5

import java.awt.Graphics2D;

import myMath.MyCurve;
import myMath.Tpl20;

public class TestMyParameter073 extends Tpl20 {

	public void draw2(Graphics2D g2) {
		MyPara1 pf = new MyPara1();

		draw(pf, 0, 2 * Math.PI);
	}

	class MyPara1 extends MyCurve {
		double a = 4;
		double b = 5;

		public void p(double t) {
			x = Math.sin(a * t);
			y = Math.sin(b * t);
		}
	}
}

[前へ] [戻る] [次へ]