How to draw a circle in the octave version of gnu version 3.8:

The code:
octave> x = -1:0.01:1; octave> y = (1 - x .^ 2) .^ 0.5; octave> plot(x,y, "linewidth", 4, x,-y, "linewidth", 4);
verbalization:
Create a list between -1 and 1 in increments of .01 to represent the x axis. The y axis is the diameter of the circle minus the value at each x-square index, all raised to 0.5 .
Graph x and y (blue), which gives the top half of the circle, then point x to -y, which inverts the top (green), creating the bottom half of the circle.
Alternatively use linspace:

The code:
octave> r = 1; octave> t = linspace(0,2.*pi,1); octave> circsx = r.*cos(t) + x; octave> circsy = r.*sin(t) + y; octave> plot(circsx,circsy, "linewidth", 4, circsx, -circsy, "linewidth", 4);
verbalization:
Draws a circle.
Eric Leschinski
source share