from visual import *
curve(pos=[(-15,-15,15),(-15,15,15),(15,15,15),(15,-15,15),(-15,-15,15)])
curve(pos=[(-15,-15,-15),(-15,15,-15),(15,15,-15),(15,-15,-15),(-15,-15,-15)])
curve(pos=[(15,-15,15),(15,-15,-15)])
curve(pos=[(-15,-15,15),(-15,-15,-15)])
curve(pos=[(-15,15,15),(-15,15,-15)])
curve(pos=[(15,15,15),(15,15,-15)])
points(pos=[(0,0,0)])
label(pos=(15,0,0), text = 'x+')
label(pos=(0,0,15), text = 'z+')
label(pos=(0,15,0), text = 'y+')
label(pos=(0,0,0), text = 'O')
x = -10
y = -10
z = -10
while z <= 10:
a = .5*x #the area of interest, this is where you set a,b,c equal to a equations for x, y, z
b = .5*y
c = .5*z
d = arrow(pos = (x,y,z), axis = (a,b,c))
if x < 10:
x = x+5
elif y < 10:
y = y+5
x = -10
elif z <= 10:
z = z+5
y = -10
x = -10
So I need to set the individual variables a,b,c equal to different equations of x,y,z. How am I supposed to do this without editing the code each time, if I can assign a some type of variable to these equations, I can easily create an input.I have no idea. I am new to python BTW, picked it up to create a program for vector fields.

New Topic/Question
Reply



MultiQuote




|