java - Creating a Squircle -


I am a first year programmer I am trying to create a squircle (square with rounded corners).

So far I have been able to get it. I have given the constants of A, B and R. If someone can help, I would be truly grateful. I am a total noob for this, so be good :)

Package SQUIRCAL; Import java.awt. *; Import javax.swing *; Import java.lang.Math; Public Class Main javax.swing.JApplet {Public Zero Color (Graphics G) {// (xa) ^ 4 + (yb) ^ 4 = R ^ 4 / y = Quadruple (R ^ 4 - (xa) ^ 4 Has been done. + B) // X values ​​should fall within AR & lt; X & lt; A + r int [] exponent = new int [200]; Int [] ypoints = new int [200]; Int [] mypoints = new int [200]; (Int c = 0; c 100) {// y = y * 1; //} // else if (c & lt; 100) {// y = y * 1; //} xPoints [c] = (int) x; YPoints [c] = (int) y; // You get X coordinates to change the equation. Change it to find Y coordination. // r is the modest radius // (a, b) is the location of the center / a = 100 // b = 100 // r = 100 // the value should fall within 0 or 200} g.drawpolygon (X points, YPoints, xPoints.length); G.drawPolygon (X Points, (MyPoints), Expand Lamps); }}

Is this homework or is there any other reason why you can not use it Are Graphics # Drorendrect () ?


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -