34 lines
602 B
JavaScript
34 lines
602 B
JavaScript
let n = 4;
|
|
let N = 100;
|
|
let x = Array.from(Array(N).keys());
|
|
x = x.map( (element) => element * n * 2 * Math.PI / N );
|
|
let y = x.map((element) => Math.sin(element));
|
|
let a = x.map((element) => Math.cos(element));
|
|
let b = x.map((element) => - Math.sin(element));
|
|
let c = x.map((element) => - Math.cos(element));
|
|
|
|
let pyplot = new jsplot();
|
|
pyplot.plot({
|
|
x: x ,
|
|
y: y ,
|
|
linecolor: 'green',
|
|
});
|
|
pyplot.title('4 sinus');
|
|
pyplot.show();
|
|
pyplot.plot({
|
|
x: x,
|
|
y: y,
|
|
});
|
|
pyplot.plot({
|
|
x: x,
|
|
y: a,
|
|
});
|
|
pyplot.plot({
|
|
x: x,
|
|
y: b,
|
|
});
|
|
pyplot.plot({
|
|
x: x,
|
|
y: c,
|
|
});
|
|
pyplot.show();
|