-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I have a JessieCode snippet as follow:
```jessiecode
FFunc = function(x) {
return sin(x);
};
F = functiongraph(FFunc, -10, 10);
P1 = point(0, 0);
P2 = point(1, 2);
a = function () {
return P2.X() - P1.X();
};
b = function () {
return P2.Y() - P1.Y();
};
GFunc = function(x) {
return b() * sin(PI * ( x - P1.X() ) / 2 / a() ) + P1.Y();
};
G = functiongraph(GFunc, -10, 10);
InterFunc = function(i, x) {
return FFunc(x) * i / 10 + GFunc(x) * (1 - i / 10);
};
for (i = 1; i <= 9; i = i + 1) {
functiongraph(function(x) {
return InterFunc(i, x);
}, -10, 10) << strokeOpacity: 0.5 >>;
}
```Expected
I expected it could render graphs as follow:
Behavior
But it actually rendered as bellow:
Why it was so and how can I fix it?
In addition
I also tried about this snippet:
```jessiecode
FFunc = function(x) {
return sin(x);
};
F = functiongraph(FFunc, -10, 10);
P1 = point(0, 0);
P2 = point(1, 2);
a = function () {
return P2.X() - P1.X();
};
b = function () {
return P2.Y() - P1.Y();
};
GFunc = function(x) {
return b() * sin(PI * ( x - P1.X() ) / 2 / a() ) + P1.Y();
};
G = functiongraph(GFunc, -10, 10);
InterFunc = function(i) {
return function(x) {
return FFunc(x) * i / 10 + GFunc(x) * (1 - i / 10);
};
};
for (i = 1; i <= 9; i = i + 1) {
functiongraph(InterFunc(i), -10, 10) << strokeOpacity: 0.5 >>;
}
```And it result in Operation - not defined on operands object and number
Metadata
Metadata
Assignees
Labels
No labels

