# Maurer rose

In geometry, the concept of a Maurer rose was introduced by Peter M. Maurer in his article titled A Rose is a Rose.... A Maurer rose consists of some lines that connect some points on a rose curve.

## Definition

Let r = sin() be a rose in the polar coordinate system, where n is a positive integer. The rose has n petals if n is odd, and 2n petals if n is even.

We then take 361 points on the rose:

(sin(nk), k) (k = 0, d, 2d, 3d, ..., 360d),

where d is a positive integer and the angles are in degrees, not radians.

## Explanation

A Maurer rose of the rose r = sin() consists of the 360 lines successively connecting the above 361 points. Thus a Maurer rose is a polygonal curve with vertices on a rose.

A Maurer rose can be described as a closed route in the polar plane. A walker starts a journey from the origin, (0, 0), and walks along a line to the point (sin(nd), d). Then, in the second leg of the journey, the walker walks along a line to the next point, (sin(n·2d), 2d), and so on. Finally, in the final leg of the journey, the walker walks along a line, from (sin(n·359d), 359d) to the ending point, (sin(n·360d), 360d). The whole route is the Maurer rose of the rose r = sin(). A Maurer rose is a closed curve since the starting point, (0, 0) and the ending point, (sin(n·360d), 360d), coincide.

The following figure shows the evolution of a Maurer rose (n = 2, d = 29° ).

## Images

The following are some Maurer roses drawn with some values for n and d:

## Syntax examples

### JavaScript code

```// Boilerplate, gotta be somewhere, right?
document.body.outerHTML = ''; // Strips the page of its stuff, in case you just want to paste this into the console in a new tab or really anywhere.
const canv = document.createElement('canvas');
canv.width = 800;
canv.height = 800;
document.body.appendChild(canv);
const ctx = canv.getContext('2d');

// Alright, rose time.
let n = 6, d = 71; // These can be any combination, but this one is nice.

ctx.beginPath();
ctx.lineWidth = 0.5;
ctx.strokeStyle = 'blue';
for (let theta = 0; theta <= 360 /* we're working with degrees, remember? */; theta++){
let k = theta * d * Math.PI / 180;
let r = 300 * Math.sin(n * k);
let x = r * Math.cos(k) + canv.width/2;
let y = r * Math.sin(k) + canv.height/2;
ctx.lineTo(x, y);
ctx.moveTo(x, y);
}
ctx.stroke();
ctx.beginPath();
ctx.lineWidth = 4;
ctx.strokeStyle = 'red';
for (let theta = 0; theta <= 360; theta++){
let k = theta * Math.PI / 180;
let r = 300 * Math.sin(n * k);
let x = r * Math.cos(k) + canv.width/2;
let y = r * Math.sin(k) + canv.height/2;
ctx.lineTo(x, y);
ctx.moveTo(x, y);
}
ctx.stroke();
```

### Processing code

```float n = 6;
float d = 71;

size(800, 800);

noFill();
background(255);
beginShape();
stroke(0, 0, 255);
strokeWeight(0.5);
for(int theta = 0; theta <= 360; theta++){
float k = theta * d * PI / 180;
float r = 300 * sin(n * k);
float x = r * cos(k) + width/2;
float y = r * sin(k) + height/2;
vertex(x, y);
}
endShape();

beginShape();
stroke(255, 0, 0);
strokeWeight(4);
for(int theta = 0; theta <= 360; theta++){
float k = theta * PI / 180;
float r = 300 * sin(n * k);
float x = r * cos(k) + width/2;
float y = r * sin(k) + height/2;
vertex(x, y);
}
endShape();
```

### Python code

Python isn't very efficient when it comes to drawing, so it takes a while. But, the rose won't be upside down like it would in most other languages thanks to Turtle Graphics' ways.

```import math, turtle

screen = turtle.Screen()
screen.setup(width=800, height=800, startx=0, starty=0)
screen.bgcolor('black')
pen = turtle.Turtle()
pen.speed(20)
n = 5
d = 97

pen.color('blue')
pen.pensize(0.5)
for theta in range(361):
k = theta * d * math.pi / 180
r = 300 * math.sin(n * k)
x = r * math.cos(k)
y = r * math.sin(k)
pen.goto(x, y)

pen.color('red')
pen.pensize(4)
for theta in range(361):
k = theta * math.pi / 180
r = 300 * math.sin(n * k)
x = r * math.cos(k)
y = r * math.sin(k)
pen.goto(x, y)
```