You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like the color of the Arrows to change depending on the value of F you get for them.
This could happen inside this function.
function drawElectricField() {
for (let x = 0; x < 1200; x += 40) {
for (let y = 0; y < 1200; y += 40) {
let base = new Complex(x, y);
let F = calculateElectricFieldVector(base).mul(1e15);
//getColor(F) get corresponding color out of F value
let absF = F.abs();
F = F.mul(1/absF);
drawArrow(base, new Complex(base.re + F.re, base.im + F.im),[35, 144, 145]);
}
}
}
The color variable is already a parameter of my drawArrow funciton.
The text was updated successfully, but these errors were encountered:
xlikesasukee
changed the title
Electric Field: Change the Color of the Arrows depending on Force applied to them.
Electric Field: Change the color of the arrows depending on the force applied to them.
Jul 7, 2023
I would like the color of the Arrows to change depending on the value of F you get for them.
This could happen inside this function.
The color variable is already a parameter of my drawArrow funciton.
The text was updated successfully, but these errors were encountered: