<p>After exploring closer, the wrong curve turns to be the blue one, created after the answer to this question in the math community:</p>
<p><a href="http://www.telegraphics.net/sw/info/sinehow.html" rel="nofollow noreferrer">https://math.stackexchange.com/questions/4235124/getting-the-most-accurate-bezier-curve-that-plots-a-sine-wave</a></p>
<p>Although it is possible to approximate the whole sine period with a single bezier segment, it is not recommended and there is nothing wrong to use two segments, as recommended in the following link:</p>
<p><a href="http://www.telegraphics.net/sw/info/sinehow.html" rel="nofollow noreferrer">http://www.telegraphics.net/sw/info/sinehow.html</a></p>
<p>That's what I did so I considere this question solved.</p>

CC BY-SA 4.0
2024-04-05T18:49:17.317Z
2024-04-05T18:49:17.317Z
user2309000
<p>I have found here similar questions for other languages like SVG but they don't quite answer this particular question.</p>
<p>I want to find a good approximation of the first 90 degrees of a sine curve with bezier in postscript. I have found the full 360 curve, I tried to subdivide it using a known algorithm but the result is not exactly 90 degrees. Then by try and error I got something acceptable (blue curve over the red one) but when I scale it horizontally, it doesn't fit with the sine curve (black curve) so I am confuse about if a scalable bezier approximation is possible.</p>
<p><a href="https://i.sstatic.net/4LzJl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4LzJl.png" alt="Encapsulated postscript of my intended approximation of a sine curve" /></a></p>
<p>This is the PostScript code:</p>
<pre><code>1 0 0 setrgbcolor

% Full 360 degree period curve
0 0  moveto
0.4673 3.4641 0.5327 -3.4641 1 0 curveto
stroke

% 90 degree aprox
0 0 1 setrgbcolor
0 0 moveto
0.116825 0.866025 0.20 1.0  0.25 1 curveto
stroke

% Same as above but scaled 4x horizontally
0 0  moveto
0.4673 0.866025  0.8 1  1 1 curveto
stroke
</code></pre>
<p>I will appreciate any hint.</p>

<bezier-curve>
How to approximate a 90 degrees sine with a bezier curve in PostScript
user2309000
# How to approximate a 90 degrees sine with a bezier curve in PostScript

(Asked by: username_0 on 2024-04-04)

I have found here similar questions for other languages like SVG but they don't quite answer this particular question.

I want to find a good approximation of the first 90 degrees of a sine curve with bezier in postscript. I have found the full 360 curve, I tried to subdivide it using a known algorithm but the result is not exactly 90 degrees. Then by try and error I got something acceptable (blue curve over the red one) but when I scale it horizontally, it doesn't fit with the sine curve (black curve) so I am confuse about if a scalable bezier approximation is possible.

[![Encapsulated postscript of my intended approximation of a sine curve](https://i.sstatic.net/4LzJl.png)](https://i.sstatic.net/4LzJl.png)

This is the PostScript code:

```
1 0 0 setrgbcolor

% Full 360 degree period curve
0 0  moveto
0.4673 3.4641 0.5327 -3.4641 1 0 curveto
stroke

% 90 degree aprox
0 0 1 setrgbcolor
0 0 moveto
0.116825 0.866025 0.20 1.0  0.25 1 curveto
stroke

% Same as above but scaled 4x horizontally
0 0  moveto
0.4673 0.866025  0.8 1  1 1 curveto
stroke

```

I will appreciate any hint.

**Tags:** bezier-curve


---

## 1 answers

### Answer by username_0 on 2024-04-05. Score: 1

After exploring closer, the wrong curve turns to be the blue one, created after the answer to this question in the math community:

[https://math.stackexchange.com/questions/4235124/getting-the-most-accurate-bezier-curve-that-plots-a-sine-wave](http://www.telegraphics.net/sw/info/sinehow.html)

Although it is possible to approximate the whole sine period with a single bezier segment, it is not recommended and there is nothing wrong to use two segments, as recommended in the following link:

<http://www.telegraphics.net/sw/info/sinehow.html>

That's what I did so I considere this question solved.


---

