Basic star
JavaScript
var paper = Raphael(0, 0, 500, 500);
function star(x, y, r) {
// start at the top point
var path = "M" + x + "," + (y - r);
// let's draw this the way we might by hand, by connecting each point the one two-fifths of the way around the clock
for (var c = 0; c < 6; c += 1) {
var angle = 270 + c * 144,
rx = x + r * Math.cos(angle * Math.PI / 180),
ry = y + r * Math.sin(angle * Math.PI / 180);
path += "L" + rx + "," + ry;
}
return paper.path(path);
}
function test(){
}
test();
//star(50, 50, 40);
//star(150, 80, 30).attr({
// stroke: "none",
//fill: "green"
//});