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

OdsXmasTree.png

data xmastree;
r=4; h=11.25;
a=arsin(r/(r**2+h**2)**.5);
do y=-r to r by .02;
  do x=-r to r by .02;
    z=h-(x**2+y**2)**.5/sin(a)*cos(a);
    if (x**2+y**2)**.5>4 | 1.25<z<2|3.25<z<4|5.25<z<6|7.25<z<8|9.25<z<10 then z=.; 
    output;
  end;
end;

proc template;
define statgraph xmastree;
begingraph;
drawtext textattrs=(size=50pt COLOR=gold FAMILY="Arial Unicode MS") {unicode "2605"x} /
         anchor=topleft widthunit=percent x=46.5 y=99 justify=center ;
layout overlay3d / cube=false;
surfaceplotparm x=x y=y z=z / fillattrs=(color=forestgreen);
endlayout;
endgraph;
end;

proc sgrender data=xmastree template=xmastree;
run;
3 REPLIES 3
Jay54
Meteorite | Level 14

Very cool, indeed.

SASKiwi
PROC Star

Nice. I think it is right up there with the cowboy hat!

MichelleHomes
Meteorite | Level 14

An awesome trignometric SASmas tree! Smiley Happy Heart Nice work.

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3780 views
  • 9 likes
  • 4 in conversation