Python Forum
Code for a circular wire??
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code for a circular wire??
#1
Hey everyone, so I'm trying to create a code for a circular wire carrying a current from which I can then apply the Biot-Savart law to. However, due to my lack of coding knowledge I'm stumped on how to exactly define my wire (which has a radius of 1). Below was my thought process.

theta = range(0, 2*math.pi)
r = 1.0 #Radius
x = r*math.cos(theta)
y = r*math.sin(theta)
wire = 2*math.pi*math.sqrt((x**2)+(y**2))

This may appear instantly wrong to those of you with decent coding experience. Any suggestions would be greatly appreciated! (I just need a defined circumference representing my wire but I don't know how to properly code theta to include points between 0 and 2pi)
Reply


Messages In This Thread
Code for a circular wire?? - by hiphopopot0mous - Nov-29-2017, 07:59 PM
RE: Code for a circular wire?? - by micseydel - Nov-30-2017, 07:33 PM
RE: Code for a circular wire?? - by hiphopopot0mous - Nov-30-2017, 07:38 PM
RE: Code for a circular wire?? - by micseydel - Nov-30-2017, 07:41 PM
RE: Code for a circular wire?? - by hiphopopot0mous - Nov-30-2017, 07:53 PM
RE: Code for a circular wire?? - by Larz60+ - Nov-30-2017, 07:59 PM
RE: Code for a circular wire?? - by sparkz_alot - Nov-30-2017, 08:30 PM
RE: Code for a circular wire?? - by hiphopopot0mous - Dec-02-2017, 07:31 PM
RE: Code for a circular wire?? - by micseydel - Dec-03-2017, 06:23 PM
[split2] Code for a circular wire?? - by Larz60+ - Nov-29-2017, 08:16 PM
How to define a grid? - by hiphopopot0mous - Nov-30-2017, 07:13 PM
RE: How to define a grid? - by micseydel - Nov-30-2017, 07:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating a circular matrix with one input omnisierra 18 5,788 Oct-02-2020, 01:51 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020