I have a Mac. I know that I can install Python on Macs, Linux & Windows. I am interested in getting into Linux.
I’ve watched YouTube videos about Turtle. A long time ago, before BASIC was Visual BASIC, I created a program that plotted trig functions. They looked right neat. X equals a trig function & Y equals a trig function & then plot both. I suppose that I would need to use Matplotlib in order to plot trig functions.
The value for “Left” & “Right” is degrees. I suppose that I can have a random number generator in the program to create random integer values between 0 & 360. Would I also need to create negative random numbers since the origin is at the center of the screen? Can I move the origin to the top-left or bottom-left of the screen?
What are the X,Y coordinate values? Are they pixels?
I have a 27” 1080P monitor. Is is possible to make the program output full-screen?
I found out that Thonny includes Python & Python includes IDLE. I’ve watched YouTube videos explaining the differences. I’d rather use the GUI Thonny. I suppose that installing Thonny installs both Thonny AND Python. I suppose also that both Thonny & Python can be upgraded.
if you will be using degrees as entries, you don’t need negative numbers. What you will need is an accompanying magnitude (vector form). For example, say you move left 5 units, and down 8 units, then you will be at coordinate (-5, -8) - the third quadrant. From trig, you know that the square root of the sum of the squares of these two values is the magnitude. So, if you are given an angle, you can accompany it with the the corresponding magnitude.
The equivalent vector form for the x and y entries of (-5, -8) is: 9.43 /_ 238°. (9.43 is the magnitude and 238° is the corresponding angle).
Here is an online graphing tool that plots these values:
What I am saying is that you can represent the same location via two methods:
Supplying the x and y coordinates
Supplying the magnitude and angle
Here is an example. Note how you can represent the same location by either (x, y) = (2, 3) pair or vector notation via magnitude /_ angle° = 3.6 /_ 56.3°. Note that if you take the square root of the sum of the squares of 2 and 3, you get 3.6.
It is my poor representation for the angle symbol ( /_ ) which I attempted via a forward slash and an underscore. See the graph screenshot above in the red box.
Yes, this is why they are positive (0° - 360°). However, you can also represent the same angle with a negative. For example, 270° is the same as -90°. It all depends on your reference.
If so, then you have to be comfortable working with vector notation (magnitude + angle) and a little bit with trigonometry.
I’ve watched YouTube videos about Turtle & all of the examples use degrees between the parentheses after “left” or “right”. The videos really didn’t say that one can use X,Y coordinates or degrees in the “left” & “right” commands.
I personally prefer to use either degrees or X,Y coordinates.
Now, related questions.
Are the units in the “forward” & “back” commands pixels? I have a 27” 1080P monitor. Can the pixels in the commands be almost as high as 1920 & 1080? I’d love to see my “art” full screen!
The turtle moves .forward() or .backward() in the direction that it’s facing. You can change this direction by turning it .left() or .right() by a certain degree.
For direction:
.forward() or .backward()
For degree shift from current facing position:
.forward() or .backward()
I don’t know. Test it and see how it performs for your specific screen.