Jump to content

Parametric equations in VEX


davidyannick

Recommended Posts

Well i guess it's something like :

float a = chf("a");
float b = chf("b");
float t = chf("t");

float x = a * (1 - sin(t)) * cos(t);
float y = b * (sin(t) - 1);

But depending on what you feed into the equation you may need to change from float to vector or vector4.

https://www.sidefx.com/docs/houdini/vex/functions/cos.html

 

Cheers,

Link to comment
Share on other sites

5 minutes ago, DonRomano said:

Well i guess it's something like :


float a = chf("a");
float b = chf("b");
float t = chf("t");

float x = a * (1 - sin(t)) * cos(t);
float y = b * (sin(t) - 1);

But depending on what you feed into the equation you may need to change from float to vector or vector4.

https://www.sidefx.com/docs/houdini/vex/functions/cos.html

 

Cheers,

thx I've found, I had forgotten the domain of definition 

vector pos=0;
int pt[]={};

float q=chf("q");

int i=0;

for(float t=-$PI;t<$PI;t+=$PI/100){

    float aa=pow(q,2)*pow(sin(t),2);
    float ab=pow((1-q+q*cos(t)),2);
    float ac=aa+ab;
    float ad=q*sin(t)/ac;
    
    pos.x=q*sin(t)-ad;
    float da=q*cos(t)+((1-q+q*cos(t))/ac);
    pos.y=da;
    
    pt[i]=addpoint(0,pos);
    i++;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...