Csound Csound-dev Csound-tekno Search About

[Csnd] Question re: Canonical manual description of wterrain2 curve param.

Date2022-10-20 06:26
FromScott Daughtrey
Subject[Csnd] Question re: Canonical manual description of wterrain2 curve param.
These two equations appear identical to me. I'm not great at math but I assume there should be a difference between the two. Am I simply overlooking something? 
kcurve=2: limacon
        fx(t) = kx + krx * sin(t) * (cos(t) + kcurveparam)
        fy(t) = ky + kry * cos(t) * (cos(t) + kcurveparam)
kcurve=3: cornoid
        fx(t) = kx + krx * sin(t) * (cos(t) + kcurveparam)
        fy(t) = ky + kry * cos(t) * (cos(t) + kcurveparam)

Can anyone suggest which one is incorrect and what the correct equation is?

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-10-20 09:38
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Question re: Canonical manual description of wterrain2 curve param.
Looking this up, it appears the two equations, which are the same, describe a limaçon shape but someone needs to check that the code agrees to it.

The cornoid seems to have a cos^2 inside the parenthesis. 

That said, I know next to nothing about the subject.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 20 Oct 2022, at 06:25, Scott Daughtrey  wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> These two equations appear identical to me. I'm not great at math but I assume there should be a difference between the two. Am I simply overlooking something?
> kcurve=2: limacon
>        fx(t) = kx + krx * sin(t) * (cos(t) + kcurveparam)
>        fy(t) = ky + kry * cos(t) * (cos(t) + kcurveparam)
> kcurve=3: cornoid
>        fx(t) = kx + krx * sin(t) * (cos(t) + kcurveparam)
>        fy(t) = ky + kry * cos(t) * (cos(t) + kcurveparam)
> 
> Can anyone suggest which one is incorrect and what the correct equation is?
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cda0c03280c8443d5884508dab25b8aab%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638018403487276286%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TRH%2FqgLuL6KrmH3cmsUtt0yU%2F8wq%2BQ3KYcZtO7CuN9E%3D&reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cda0c03280c8443d5884508dab25b8aab%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638018403487276286%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=g%2FH6ekgvbiY9B96eyglVedvEkJBUFell7aXriGYuS5s%3D&reserved=0
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-10-20 16:01
FromdocB <000005d2745f1ec0-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Question re: Canonical manual description of wterrain2 curve param.
The correct formula for cornoid which is also implemented in the opcode is

fx(t) = kx + krx * cos(t) * cos(2*t);
fy(t) = ky + kry * sin(t) * (kcurveparam + cos(2*t));

it's wrong in the manual.

An visual demo of the wterrain2 opcode can be found here:

https://docb.io/waveterrain/



On 10/20/22 07:26, Scott Daughtrey wrote:
> These two equations appear identical to me. I'm not great at math but I assume there should be a difference between the two. Am I simply overlooking something?
> kcurve=2: limacon
>          fx(t) = kx + krx * sin(t) * (cos(t) + kcurveparam)
>          fy(t) = ky + kry * cos(t) * (cos(t) + kcurveparam)
> kcurve=3: cornoid
>          fx(t) = kx + krx * sin(t) * (cos(t) + kcurveparam)
>          fy(t) = ky + kry * cos(t) * (cos(t) + kcurveparam)
>
> Can anyone suggest which one is incorrect and what the correct equation is?
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here