Re: polar coordinates?

2018-12-19 Thread Brian Christiansen

On 12/19/18 12:19 PM, Dennis Lee Bieber wrote:


I don't see anything in your code that makes any use of
polar<>rectangular coordinate conversion -- which is what you were
interested in when starting the thread. You appear to just be rastering a
15x15 rectangle (ie: the first 225 digits. If you really want to plot all
the digits you provide, you should be looping over /them/, not some
arbitrary X and Y coordinates.


I didn't say I yet had what I need to use polar coordinates for yet 
working, or that I even yet had done anything past some planning in my 
head.  In the numberphile video I linked to, the 3rd (I think) way to 
represent PI (the one professor Grimes says looks like the tiling in a 
Roman bathhouse) and I think the 4th way (the one that is the other 
guy's favorite I think) have only been designed a bit in my head so far. 
 I just think those 2 ways, which no code has been written for yet, 
would be easier to do using polar coordinates.  And yes, I know there 
are ways that I could have used all 1000 digits of PI rather than just 
49 of them.

pi1000 =
[3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5,0,2,8,
   8,4,1,9,7,1,6,9,3,9,9,3,7,5,1,0,



   8,7,6,6,1,1,1,9,5,9,0,9,2,1,6,4,2,0,1,9,8,9]


Pardon me while I go UGH!... That must have been tedious to enter (and
why double spaced). This may add a few milliseconds in processing (I'll
explain later), but looks a lot cleaner:

pi1000 = ("3.1415926535897932384626433832795028"
"8419716939937510582097494459230781"

"8766111959092164201989")


As for putting in the value for PI, it was actually rather easy.  To get 
the number itself, I just searched for and downloaded a file that had PI 
to 1000 places and copied and pasted it into the editor.  As for the 
commas, at least to my current understanding of python, I thought those 
had to between the elements of an array.  As for putting in the commas, 
I did that by using the "replace all" function in my IDE (or perhaps I 
used gedit, a linux version of notepad) to replace all the "0" with 
"0,", "1" with "1,", etc, so that was not very tedious and was actually 
pretty fast.  As for the double spacing, like I said it seems that 
usenet (or perhaps my usenet viewer) seems to mess with spacing or 
whatever, they do not exist on the actual program on my compputer.



Python will concatenate adjacent strings, so that becomes just one long
string internally -- if you were to "print pi1000" (Python 2.x syntax) it
would display:

3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164

20

1989


Consider this; I spent way too much time generating the code when I
should be out shopping for Christmas (watch out for line wrapping):

-=-=-=-=-
import math

import matplotlib as mpl
import matplotlib.pyplot as plt

PI1000 = ("3.1415926535897932384626433832795028"
"8419716939937510582097494459230781"
"64062862089986280348253421170679821"
"48086513282306647093844609550582231"
"72535940812848111745028410270193852"
"11055596446229489549303819644288109"
"75665933446128475648233786783165271"
"20190914564856692346034861045432664"
"82133936072602491412737245870066063"
"15588174881520920962829254091715364"
"36789259036001133053054882046652138"
"41469519415116094330572703657595919"
"53092186117381932611793105118548074"
"46237996274956735188575272489122793"
"81830119491298336733624406566430860"
"21394946395224737190702179860943702"
"77053921717629317675238467481846766"
"94051320005681271452635608277857713"
"427577896091736371787214684409

Re: polar coordinates?

2018-12-18 Thread Brian Christiansen
I don't think what I am currently doing is heat maps, but at least from 
what I have read, they could be adapted to "visualiztions of PI."


Toward that end I decided to put a link to the video that inspired me, a 
link to where I got the graphics.py package (or at least where I think I 
got it), and the actual program I currently have.


Numberphile video about visualiztion of PI: 
https://www.youtube.com/watch?v=NPoj8lk9Fo4


Where I got graphics.py, the graphics package I am currently using (this 
is a link to the actual file I am using: 
tmcsp.wartburg.edu/zelle/pyhon/graphics.py


The program I currently have working.  It is a bit simplistic, it does 
not vary the size of the grid that is made, etc.  It also looks like to 
me that I did not really update my comments that described how big I was 
making my dots to match how big I was actually making my dots.  Also, 
simply cutting and pasting it, even if you have graphics.py in the 
"python path" may not work, since sometimes usenet seems to mess with 
spaces.:


from graphics import *
import random

pi1000 = 
[3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5,0,2,8,
  8,4,1,9,7,1,6,9,3,9,9,3,7,5,1,0, 
5,8,2,0,9,7,4,9,4,4,5,9,2,3,0,7,8,1,


6,4,0,6,2,8,6,2,0,8,9,9,8,6,2,8,0,3,4,8,2,5,3,4,2,1,1,7,0,6,7,9,8,2,1,

4,8,0,8,6,5,1,3,2,8,2,3,0,6,6,4,7,0,9,3,8,4,4,6,0,9,5,5,0,5,8,2,2,3,1,

7,2,5,3,5,9,4,0,8,1,2,8,4,8,1,1,1,7,4,5,0,2,8,4,1,0,2,7,0,1,9,3,8,5,2,

1,1,0,5,5,5,9,6,4,4,6,2,2,9,4,8,9,5,4,9,3,0,3,8,1,9,6,4,4,2,8,8,1,0,9,

7,5,6,6,5,9,3,3,4,4,6,1,2,8,4,7,5,6,4,8,2,3,3,7,8,6,7,8,3,1,6,5,2,7,1,

2,0,1,9,0,9,1,4,5,6,4,8,5,6,6,9,2,3,4,6,0,3,4,8,6,1,0,4,5,4,3,2,6,6,4,

8,2,1,3,3,9,3,6,0,7,2,6,0,2,4,9,1,4,1,2,7,3,7,2,4,5,8,7,0,0,6,6,0,6,3,

1,5,5,8,8,1,7,4,8,8,1,5,2,0,9,2,0,9,6,2,8,2,9,2,5,4,0,9,1,7,1,5,3,6,4,

3,6,7,8,9,2,5,9,0,3,6,0,0,1,1,3,3,0,5,3,0,5,4,8,8,2,0,4,6,6,5,2,1,3,8,

4,1,4,6,9,5,1,9,4,1,5,1,1,6,0,9,4,3,3,0,5,7,2,7,0,3,6,5,7,5,9,5,9,1,9,

5,3,0,9,2,1,8,6,1,1,7,3,8,1,9,3,2,6,1,1,7,9,3,1,0,5,1,1,8,5,4,8,0,7,4,

4,6,2,3,7,9,9,6,2,7,4,9,5,6,7,3,5,1,8,8,5,7,5,2,7,2,4,8,9,1,2,2,7,9,3,

8,1,8,3,0,1,1,9,4,9,1,2,9,8,3,3,6,7,3,3,6,2,4,4,0,6,5,6,6,4,3,0,8,6,0,

2,1,3,9,4,9,4,6,3,9,5,2,2,4,7,3,7,1,9,0,7,0,2,1,7,9,8,6,0,9,4,3,7,0,2,

7,7,0,5,3,9,2,1,7,1,7,6,2,9,3,1,7,6,7,5,2,3,8,4,6,7,4,8,1,8,4,6,7,6,6,

9,4,0,5,1,3,2,0,0,0,5,6,8,1,2,7,1,4,5,2,6,3,5,6,0,8,2,7,7,8,5,7,7,1,3,

4,2,7,5,7,7,8,9,6,0,9,1,7,3,6,3,7,1,7,8,7,2,1,4,6,8,4,4,0,9,0,1,2,2,4,

9,5,3,4,3,0,1,4,6,5,4,9,5,8,5,3,7,1,0,5,0,7,9,2,2,7,9,6,8,9,2,5,8,9,2,

3,5,4,2,0,1,9,9,5,6,1,1,2,1,2,9,0,2,1,9,6,0,8,6,4,0,3,4,4,1,8,1,5,9,8,

1,3,6,2,9,7,7,4,7,7,1,3,0,9,9,6,0,5,1,8,7,0,7,2,1,1,3,4,9,9,9,9,9,9,8,

3,7,2,9,7,8,0,4,9,9,5,1,0,5,9,7,3,1,7,3,2,8,1,6,0,9,6,3,1,8,5,9,5,0,2,

4,4,5,9,4,5,5,3,4,6,9,0,8,3,0,2,6,4,2,5,2,2,3,0,8,2,5,3,3,4,4,6,8,5,0,

3,5,2,6,1,9,3,1,1,8,8,1,7,1,0,1,0,0,0,3,1,3,7,8,3,8,7,5,2,8,8,6,5,8,7,

5,3,3,2,0,8,3,8,1,4,2,0,6,1,7,1,7,7,6,6,9,1,4,7,3,0,3,5,9,8,2,5,3,4,9,

0,4,2,8,7,5,5,4,6,8,7,3,1,1,5,9,5,6,2,8,6,3,8,8,2,3,5,3,7,8,7,5,9,3,7,

5,1,9,5,7,7,8,1,8,5,7,7,8,0,5,3,2,1,7,1,2,2,6,8,0,6,6,1,3,0,0,1,9,2,7,
  8,7,6,6,1,1,1,9,5,9,0,9,2,1,6,4,2,0,1,9,8,9]
colors =  ["purple", "blue", "brown","coral","cyan","gray","green","yellow",
   "red","orange"]




def pi_as_dots():
#make window that is 700 by 700
win = GraphWin("Visualization of PI",700,700)
win.setBackground("black")
for y in range(0,14):
for x in range (0,14):
# make a circle that is centered at 14x+7, and 14y+7
pt = Point((50*x+25),(50*y+25))
cir = Circle(pt,20)
cir.setFill(colors[pi1000[y*14+x]])
cir.draw(win)
#make a circle that is a little smaller, in the same point, 
with the next color

cir = Circle(pt,15)
cir.setFill(colors[pi1000[y*14+x+1]])
cir.draw(win)


def main():

#make the simple menuing system

print("choose how to visualize pi")
print("d = dots")
choice = input('--> ')
if choice == "d":
pi_as_dots()


main()
--
My Yonkoma: https://www.flickr.com/photos/brian0908/albums/72157680223526176

The E-mail associated with the account is a "spamcatcher" account that I 
got to every couple of months to empty out, and anything sent to it will 
not be seen for probably several months, if it is seen at all.

Brian Christiansen
--
https://mail.python.org/mailman/listinfo/python-list


Re: polar coordinates?

2018-12-17 Thread Rob Gaddi

On 12/17/18 5:20 PM, Brian Christiansen wrote:
I don't know if this follow up to my original message will even be seen 
because of all the spam advertising e-books that at least from the 
titles appear to have nothing to do with python.


I apologize for being overly wordy in my description, but I suppose I 
was worried that if I did not go into great detail about exactly what I 
was trying to do, someone might suggest a package that solves part of my 
problem, but not all of it.


I downloaded and installed matplotlib.  At first I was a bit worried 
because I have seem to have 3 libraries that contain python "include" 
files: /usr/lib/python/python27, .../python3, and .../python35, and it 
at least appeared to install it into the python3 directory, but my IDE 
uses 3.5.  Well I did some of the tutorials that are on YouTube, and it 
seems to work fine.


Matplotlib makes the very simple plots that I wish to make in just a few 
statements, (scatter plot, etc.), but to make them into representations 
of PI, each dot on the scatter plot or whatever has to be a different 
color: point 1 is color(3), point 2 is color(1), point 3 is color(4), 
etc.  I am not sure if matplotlib is able to make each dot in the 
scatterplot or whatever a differnt color in the single staement that 
makes to plot, or if a loop has to be set up to draw each of the dots 
individually in a different color, but I think it will work and with 
relatively simple code.


Other statements in the thread I will take under advisement, I suppose.


If I recall correctly you can make the color argument a list with the 
same number of elements as you have points.


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list


Re: polar coordinates?

2018-12-17 Thread Chris Angelico
On Tue, Dec 18, 2018 at 12:26 PM Brian Christiansen
 wrote:
>
> I don't know if this follow up to my original message will even be seen
> because of all the spam advertising e-books that at least from the
> titles appear to have nothing to do with python.

It's easy enough to see the important information on the mailing list
(python-list@python.org). The ads you mention don't come through to
here.

> I downloaded and installed matplotlib.  At first I was a bit worried
> because I have seem to have 3 libraries that contain python "include"
> files: /usr/lib/python/python27, .../python3, and .../python35, and it
> at least appeared to install it into the python3 directory, but my IDE
> uses 3.5.  Well I did some of the tutorials that are on YouTube, and it
> seems to work fine.

The best way to install Python packages is using pip. Whatever it is
you do to run Python, just add "-m pip" and you then have pip, acting
on the same installation. For instance, I can type "python3 -m pip
install matplotlib", or "python3.7 -m pip install matplotlib" to
install into Python 3.7 (as opposed to my default Python, which is
3.8).

> Matplotlib makes the very simple plots that I wish to make in just a few
> statements, (scatter plot, etc.), but to make them into representations
> of PI, each dot on the scatter plot or whatever has to be a different
> color: point 1 is color(3), point 2 is color(1), point 3 is color(4),
> etc.  I am not sure if matplotlib is able to make each dot in the
> scatterplot or whatever a differnt color in the single staement that
> makes to plot, or if a loop has to be set up to draw each of the dots
> individually in a different color, but I think it will work and with
> relatively simple code.

Not sure, but I think it will be easy enough.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: polar coordinates?

2018-12-17 Thread Brian Christiansen
I don't know if this follow up to my original message will even be seen 
because of all the spam advertising e-books that at least from the 
titles appear to have nothing to do with python.


I apologize for being overly wordy in my description, but I suppose I 
was worried that if I did not go into great detail about exactly what I 
was trying to do, someone might suggest a package that solves part of my 
problem, but not all of it.


I downloaded and installed matplotlib.  At first I was a bit worried 
because I have seem to have 3 libraries that contain python "include" 
files: /usr/lib/python/python27, .../python3, and .../python35, and it 
at least appeared to install it into the python3 directory, but my IDE 
uses 3.5.  Well I did some of the tutorials that are on YouTube, and it 
seems to work fine.


Matplotlib makes the very simple plots that I wish to make in just a few 
statements, (scatter plot, etc.), but to make them into representations 
of PI, each dot on the scatter plot or whatever has to be a different 
color: point 1 is color(3), point 2 is color(1), point 3 is color(4), 
etc.  I am not sure if matplotlib is able to make each dot in the 
scatterplot or whatever a differnt color in the single staement that 
makes to plot, or if a loop has to be set up to draw each of the dots 
individually in a different color, but I think it will work and with 
relatively simple code.


Other statements in the thread I will take under advisement, I suppose.
--
My Yonkoma: https://www.flickr.com/photos/brian0908/albums/72157680223526176

The E-mail associated with the account is a "spamcatcher" account that I 
got to every couple of months to empty out, and anything sent to it will 
not be seen for probably several months, if it is seen at all.

Brian Christiansen
--
https://mail.python.org/mailman/listinfo/python-list


Re: polar coordinates?

2018-12-10 Thread Cousin Stanley
Brian Christiansen wrote:

> 
> I guess my question is if python can do this natively 
> or if there is a package somewhere ( polar.py ? ) that can do this
> 

  You might consider  matplotlib  for polar coordinate plotting ...

https://matplotlib.org/examples/pylab_examples/polar_demo.html


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: polar coordinates?

2018-12-09 Thread Vlastimil Brom
2018-12-09 17:30 GMT+01:00, Brian Christiansen :
> I have been messing with a program that is inspried by a video on
> youtube that is about the vizualization of pi.  I might make a post
> about that program someday, but I want to talk about something else.
> One of the ways of visualizing it is to put dots corresponding to each
> digits in a spiral pattern, in a color corresponding to what the digit
> is. I think this would be easiest, at least in the initial calculation
> of the point would be to use polar coordinates.
>
> For example, if I were to use a very simple archimedian spiral, r = 0 +
> (1 x theta), the "first 4" points, if theta increases by 1 degree
> (2pi/360 radians), are (0,0) (2pi/360 "units",2pi/360"radians")
> (4pi/360, 4pi/360) (6pi/360,6pi/360).
>
> The problem is that python (more specifically tkinter or graphics.py
> file that I downloaded) can't use polar coordinates directly to plot
> points (or at least I don't think they can).
>
[...]
> I guess my question is if python can do this natively or if there is a
> package somewhere (polar.py?) that can do this. I know there are some
> functions in cmath? that can help with parts of this, but I don't think
> that python can do all of these things natively.  If there is a package
> (or include file) that can do all of these things, I have not been able
> to find it.
>
[...]
>
> Brian Christiansen
> --
> https://mail.python.org/mailman/listinfo/python-list
>
Hi,
there were already some hints regarding the calculations;
I'd like to suggest some dedicated plotting library, if you have
special needs in this area.
E.g. matplotlib is very useful and well documented in my opinion,

cf.:
https://matplotlib.org/

for plotting using the polar projection:
https://matplotlib.org/gallery/pie_and_polar_charts/polar_demo.html#sphx-glr-gallery-pie-and-polar-charts-polar-demo-py

hth,
  vbr
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: polar coordinates?

2018-12-09 Thread Peter Otten
Oscar Benjamin wrote:

> On Sun, 9 Dec 2018 at 16:37, Brian Christiansen
>  wrote:
>>
>> I have been messing with a program that is inspried by a video on
>> youtube that is about the vizualization of pi.  I might make a post
>> about that program someday, but I want to talk about something else.
>> One of the ways of visualizing it is to put dots corresponding to each
>> digits in a spiral pattern, in a color corresponding to what the digit
>> is. I think this would be easiest, at least in the initial calculation
>> of the point would be to use polar coordinates.
>>
>> For example, if I were to use a very simple archimedian spiral, r = 0 +
>> (1 x theta), the "first 4" points, if theta increases by 1 degree
>> (2pi/360 radians), are (0,0) (2pi/360 "units",2pi/360"radians")
>> (4pi/360, 4pi/360) (6pi/360,6pi/360).
>>
>> The problem is that python (more specifically tkinter or graphics.py
>> file that I downloaded) can't use polar coordinates directly to plot
>> points (or at least I don't think they can). The polar coordinates have
>> to be converted to cartesian coordinates, then converted to the
>> coordinate system that a computer uses to actually plot points on the
>> screen.
> 
> Hi Brian,
> 
> I don't think anything exists (apart from matplotlib) to do this for you:
> https://matplotlib.org/examples/pylab_examples/polar_demo.html
> 
> Converting from polar to Cartesian coordinates is easy enough though.
> For your case if xc_p, yc_p are the pixel coordinates of the centre of
> your window and rq and thetaq are the polar coordinates for point q
> then
> 
> from math import sin, cos
> xq_p = xc_p + r * cos(theta) * pix_scale
> yq_p = yc_p - r * sin(theta) * pix_scale
> 
> gives the pixel coordinates for q. The parameter pix_scale is the
> number of pixels that corresponds to a distance of 1 in your polar
> coordinate system. You might choose this parameter based on the
> height/width in pixels of the window. Depending on what you're doing
> you may need to convert xq_p and yq_p to int rounding in some way.

Python has native support for complex numbers. With these:

>>> def angle(deg):
... return cmath.rect(1, math.radians(deg))
... 
>>> def point(c):
... return (int(c.real), int(c.imag))
... 
>>> center = 350 + 350j
>>> p = center + 350
>>> point(p)
(700, 350)

To rotate p around the center by 90 degrees:

>>> point((p-center) * angle(90) + center)
(350, 700)

Scaling can also be performed with a single multiplication

>>> scale = 2 + 2j
>>> p * 2
(1400+700j)

Another option is to let the Canvas widget do it:

http://effbot.org/tkinterbook/canvas.htm#Tkinter.Canvas.scale-method


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: polar coordinates?

2018-12-09 Thread Oscar Benjamin
On Sun, 9 Dec 2018 at 16:37, Brian Christiansen
 wrote:
>
> I have been messing with a program that is inspried by a video on
> youtube that is about the vizualization of pi.  I might make a post
> about that program someday, but I want to talk about something else.
> One of the ways of visualizing it is to put dots corresponding to each
> digits in a spiral pattern, in a color corresponding to what the digit
> is. I think this would be easiest, at least in the initial calculation
> of the point would be to use polar coordinates.
>
> For example, if I were to use a very simple archimedian spiral, r = 0 +
> (1 x theta), the "first 4" points, if theta increases by 1 degree
> (2pi/360 radians), are (0,0) (2pi/360 "units",2pi/360"radians")
> (4pi/360, 4pi/360) (6pi/360,6pi/360).
>
> The problem is that python (more specifically tkinter or graphics.py
> file that I downloaded) can't use polar coordinates directly to plot
> points (or at least I don't think they can). The polar coordinates have
> to be converted to cartesian coordinates, then converted to the
> coordinate system that a computer uses to actually plot points on the
> screen.

Hi Brian,

I don't think anything exists (apart from matplotlib) to do this for you:
https://matplotlib.org/examples/pylab_examples/polar_demo.html

Converting from polar to Cartesian coordinates is easy enough though.
For your case if xc_p, yc_p are the pixel coordinates of the centre of
your window and rq and thetaq are the polar coordinates for point q
then

from math import sin, cos
xq_p = xc_p + r * cos(theta) * pix_scale
yq_p = yc_p - r * sin(theta) * pix_scale

gives the pixel coordinates for q. The parameter pix_scale is the
number of pixels that corresponds to a distance of 1 in your polar
coordinate system. You might choose this parameter based on the
height/width in pixels of the window. Depending on what you're doing
you may need to convert xq_p and yq_p to int rounding in some way.

--
Oscar
-- 
https://mail.python.org/mailman/listinfo/python-list


polar coordinates?

2018-12-09 Thread Brian Christiansen
I have been messing with a program that is inspried by a video on 
youtube that is about the vizualization of pi.  I might make a post 
about that program someday, but I want to talk about something else. 
One of the ways of visualizing it is to put dots corresponding to each 
digits in a spiral pattern, in a color corresponding to what the digit 
is. I think this would be easiest, at least in the initial calculation 
of the point would be to use polar coordinates.


For example, if I were to use a very simple archimedian spiral, r = 0 + 
(1 x theta), the "first 4" points, if theta increases by 1 degree 
(2pi/360 radians), are (0,0) (2pi/360 "units",2pi/360"radians") 
(4pi/360, 4pi/360) (6pi/360,6pi/360).


The problem is that python (more specifically tkinter or graphics.py 
file that I downloaded) can't use polar coordinates directly to plot 
points (or at least I don't think they can). The polar coordinates have 
to be converted to cartesian coordinates, then converted to the 
coordinate system that a computer uses to actually plot points on the 
screen.


For example, the first point is just the origin, and its cartesian 
coordinates are just (0,0), but if I use the statement point(0,0) to 
plot the point, the computer will draw it at the upper left corner of 
the screen, not at the center where I want it to be, so I need to add 
however many pixels make up a "unit," to put it in the center of the 
screen.  For instance if my screen that I was drawing on is 700 by 700, 
I would have to add 350 to each coordinate value to get the point 
(350,350), then plotting on to that point would place the point where I 
want it, the center of the screen I have set up.


For the 2nd point, (2pi/360 "units", 2pi/360 radians) or (2pi/360 
"units", 1 degree), that converts to the cartesian coordinate ~(.0003 
"units",.0175 "units"), provided I did not get sin and cos mixed up, but 
then for the computer to actually plot it, the computer has to calculate 
how many actual pixels the x and y coordinates are offset from the 
origin, then add these values to the location on the computer where the 
origin is.  Since on the screen that was set up is 700 x 700 pixels 
(approximately the largest square screen I can put use on my computer), 
a "unit" is 350 pixels).


The X and Y offsets, recalcuated as pixels, is ~(350 x .0003,350 x 
.0175) or ~(.105,6.125).  Then these offsets added (or subtracted in the 
case of the y-coordinate since on a computer screen the y coordinates 
are upside down) to the actual location of the origin, (350,350), and 
rounded to the nearest integer, gives (350,344), which is the "screen 
coordinates" of the point that is actually plotted.


Basically what would happen is that a polar coordinate within a unit 
circle would be calculated, then the corresponding cartesian coordinate 
would be calculated from that, then the actual screen coordinates would 
be calculated based on where the center of the screen you set up is.


In setting up a screen, you might specify that the screen is 700 pixels 
by 700 pixels and a unit is 350 pixels.  By that mapping, any point 
outside of the unit circle (for the most part) will be off the screen. 
If a unit is defined as 175 pixels, that circle is increased to a radius 
of 2, if a unit is defined as 100 pixels, that radius is increased to 
3.5, if a unit is defined to be 50 pixels that radius is increased to 7. 
 I think defining a unit as even fewer pixels than that would lose too 
much resolution to be practical.


In sum, what all that would be is a method to map polar coordinates to 
actual screen coordinates.


I guess my question is if python can do this natively or if there is a 
package somewhere (polar.py?) that can do this. I know there are some 
functions in cmath? that can help with parts of this, but I don't think 
that python can do all of these things natively.  If there is a package 
(or include file) that can do all of these things, I have not been able 
to find it.


--
My Yonkoma: https://www.flickr.com/photos/brian0908/albums/72157680223526176

The E-mail associated with the account is a "spamcatcher" account that I 
got to every couple of months to empty out, and anything sent to it will 
not be seen for probably several months, if it is seen at all.

Brian Christiansen
--
https://mail.python.org/mailman/listinfo/python-list