Search results
May 20, 2013 · I am working on an area calculator in python, and everything seems ok,...until I get to calculating the perimeter of a circle...
May 2, 2017 · Write an abstract superclass encapsulating a shape: a shape has 2 abstract methods: one returning the perimeter of the shape, another returning the area of the shoe. It also has a constant field named PI. This class has two non-abstract subclasses: one encapsulating a circle, and the other encapsulating a rectangle.
Jan 10, 2014 · The radius of the circle should be given as an argument to the function and the equation to calculate the area is PI*r2 area = PI*r2 def SetArea (myradius, myarea): PI = 3.14159 myarea = PI*
Apr 10, 2018 · For the perimeter of a #3/4# th circle, we will add three quarters the perimeter of the full circle with twice the length of the radii.
Jan 30, 2013 · Finding Points On Perimeter Of a Circle. I need to draw line from the centre of a circle. For this I first chose centre of the image as a circle centre and draw a circle with known radius. After that using parametric equation of the circle I just calculated the x and y on perimeter by incrementing angle by 6 degree. x = cx + r * cos(a)
float x = (float)(radius * Math.Cos(angleInDegrees * Math.PI / 180F)) + origin.X; float y = (float)(radius * Math.Sin(angleInDegrees * Math.PI / 180F)) + origin.Y; return new PointF(x, y); Pre-compute the conversion factor so there's less chance you type the conversion wrong using hard-coded numbers.
Nov 3, 2013 · area and radius should be correlated. If you set the area to a given value, it should also set the radius. And if you set the radius, it should also set the area. Otherwise, you'll have a circle wich has a radius of 1 and an area of 10000, and your circle won't be a circle anymore. –
Mar 15, 2013 · Also like Xavier mentioned you have two methods with the same signature. You are also reading values from Scanner into Perimeter instance variables and then passing the uninitialized values to the Perimeter methods. So i would separate the Perimeter class and in the main read the values to local variables and pass them to Perimeter methods.
Dec 18, 2010 · Just look up the formulas for each one and write the single line of code that each requires. Sounds like somebody's classic first object-oriented assignment: double perimeter(); double area(); private double width; private double height; Rectangle(double w, double h) this.width = w; this.height = h;
May 15, 2014 · return 2*n*r*sin(pi/n) # Side length of an equal sided polygon with given radius and number of sides. def polygon_side(r, n): return polygon_perimeter(r, n)/n. Answer probably has something to do with apothem, like on this picture. Problem is, that I know only radius of the circle: python. geometry.