Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
function magicTrigFunctionX (pointRatio){
return Math.cos(pointRatio*2*Math.PI);
}
function magicTrigFunctionY (pointRatio){
return Math.sin(pointRatio*2*Math.PI);
}
//
function drawCircle(centerX, centerY, radius, sides){
//
// Move the pen to the first point on the circle.
this.moveTo(centerX + radius, centerY);
//
for(var i=0; i<=sides; i++){
var pointRatio = i/sides;
var xSteps = magicTrigFunctionX(pointRatio);
var ySteps = magicTrigFunctionY(pointRatio);
var pointX = centerX + xSteps * radius;
var pointY = centerY + ySteps * radius;
this.lineTo(pointX, pointY);
}
}
//
lineStyle(5);
//
drawCircle(150, 150, 20, 100);