BookmarkSubscribeRSS Feed
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

Egg.png

 

SAS CODE

* Fun With SAS ODS Graphics: Easter Egg Equation Hunt

  References
  1. What is mathematical equation for an egg? (Quora)
     https://www.quora.com/What-is-mathematical-equation-for-an-egg
  2. Equation of Egg Shaped Curve of the Actual Egg is Found (Nobuo Yamamoto)
     http://www.geocities.jp/nyjp07/index_egg_E.html
  3. Solution for (x^2+y^2)^2 = x^3+(3/10)xy^2 (Wolfram)
     http://www.wolframalpha.com/input/?i=(x%5E2%2By%5E2)%5E2+%3D+x%5E3%2B(3%2F10)xy%5E2
  4. The Colors of Easter
     https://www.lifewire.com/the-colors-of-easter-4126619;

data egg;                                    * Use formula to create "Easter egg" polynomial points;
id=1;
do x=0 to 1 by .0001;
  y = sqrt(-20*x**2 + sqrt(280*x + 9)*x + 3*x)/(2*sqrt(5));
  output;
end;
do x=1 to 0 by -.0001;
  y = -sqrt(-20*x**2 + sqrt(280*x + 9)*x + 3*x)/(2*sqrt(5));
  output;
end;

ods graphics / antialias ANTIALIASMAX=20100; * Polygon plot of "Easter egg";
proc sgplot data=egg aspect=1 nowall noborder;
styleattrs backcolor=cxffffe0;         
polygon x=y y=x id=id / nooutline fill fillattrs=(color=cxdda0dd) transparency=.4; * Change orientation (x=y, y=x);
yaxis reverse display=(noline noticks novalues) label="HAPPY EASTER!" labelattrs=(size=30pt color=cx40e0D0 weight=bold);
xaxis display=none;
refline .1 to .9 by .1 / lineattrs=(color=cxffffe0 thickness=2pt) axis=y; * Easter egg "stripes";
run;
3 REPLIES 3
Jay54
Meteorite | Level 14

Awesome!

Jay54
Meteorite | Level 14

Awesome!

shantanupl1
Obsidian | Level 7

awesome...loved it.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1735 views
  • 9 likes
  • 3 in conversation