what is" unhandled error:typeError:object#has no method‘trunc’"
i met this error when i am trying to understand the code below…
var twoPi = 2 * Math.PI;
this.setFlowerColor("red");
this.drawPolyStars = function(center, radius, sides, skips, startAngle) {
this.toggleFlowers(false);
var angle = startAngle;
var x = center.x;
var y = center.y;
var hoops = skips + 1;
var stepAngle = hoops * (twoPi / sides);
if(skips !== 0 && (sides % hoops) === 0) {
hoops = skips;
}
var endAngle = (twoPi * hoops) + startAngle;
while(angle <= endAngle) {
var newX = x + radius * Math.cos(angle);
var newY = y + radius * Math.sin(angle);
this.moveXY(newX, newY);
this.toggleFlowers(true);
angle += stepAngle;
}
};
var RedX={x:28,y:36};
this.drawPolyStars(RedX, 10, 6, 16, 30);