I am totally new at processing and programming in java, so the question is maybe stupid, but I can't solve it right now.
I have a variable, which represents an angle. With a slider I am able to control the angle, so everytime I use the slider the variable gets a new value. And I want to calculate the difference between the actual angle and the angle before.
So I tried to work with an array, but the second array-value is always "0".
float[] angle2 = new float[2];
int n,i;
void uebergabe() {
angle2[n] = 180-degrees(arm2_angle);
if (angle2[0] > angle2[1]) { arm2_angle_diff = angle2[0]-angle2[1];
}
else if (angle2[0] < angle2[1]) {
arm2_angle_diff = angle2[1]-angle2[0];
}
}
Hope you guys can help me, I should be simple I think :)
I downloaded a trial-version of
Mathematica, and tried to get it connect with Processing.
There is a java library called
JLink which should be able to do that.
But I have no idea how to get the library into processing..
In a sample they connect the both by "import com.wolfram.jlink.*;", but that will not work, because there is no library in the processing-libraries-folder.
So I hope you can help me to get the JLink-package into the processing lib.
is there a easy way to solve a bunch of equations?
For example, on my hand calculator I can insert my 4 equations into a "solve"- function and get a solution for my 4 unknown variables.
How can I handle it with processing?
My 4 equations are:
(1) a1² + b1² = w²
(2) a2² + b2² = x²
(3) b1 + b2 = y
(4) a1 + a2 = z
given: w, x, y, z
searched: a1, a2, b1, b2
I tried to solve it by hand, but it becomes too heavy for me.
For example:
I want to have b1:
z = sqrt( w² - b1² ) + sqrt( x² - (y - b1)² )
b1 = ...?
I was not able, even my hand calculator was not able to get b1 ...I'm searching for a better solution to do that in processing...maybe there is a solve- function or something like that...