# -*- coding: cp949 -*-
#작은 전류 요소에 의한 자기장
#저자:
#날짜: 2016-12-01
from visual import *
scene.height = scene.width = 800
L = 5.e-9
scene.range = L
#상수
m_const = 1.e-7 #자기 상수
#작은 전류 요소
source_current = 1. #전류(암페어)
source_axis = vector(0, 0.01*L, 0) #dl 벡터
source_pos = vector(0,-10*L,0) #위치
curve(pos=[(0, -10.*L, 0),(0, 10.*L, 0)], color=color.green)#dl 방향 연장선
#관찰 위치
obs_radius = 0.4*L #관찰 위치 반지름
d_theta = pi/3.
length = 2*L #자기장을 그릴 전체 거리
obs_y = -10*L #최초 관찰 위치 y 좌표
dy = L/10. #관찰 위치 증가분
obs = [source_pos] #관찰 위치 리스트
obs1 = source_pos
while obs_y < 10*L:
obs1.y += dy
obs.append(obs1)
I made this source, but It doesn`t running. I think 'while' is problem, but I don`t know the reason. What is problem?