$circle

By Mpdreamz on Oct 27, 2005

Usage: $circle(,,,)
this alias returns the x and y values for a circular path that is centered on the values where the circle is in diameter you can also use .x and .y prop to get those values individually. type /circletest to see an example

Useful if you want to draw circular motions.

alias circle {
  if ($+($1,$2,$3,$4) isnum) {
    var %x = $calc(($3 /2) * $cos($4).deg + $1) , %y = $calc(($3 /2) * $sin($4).deg + $2)  , %c
    if (!$prop) { %c = %x %y }
    else { %c = $iif($prop == x, %x,%y) }
    return %c
  }
}

alias circletest { 
  window -p @test
  var %q = 1
  while (%q <= 360) {
    clear @test
    drawdot @test 2 10 $circle(300,200,300,%q)
    inc %q .5
  }
}

Comments

Sign in to comment.
Yoinx   -  Oct 29, 2005

Pretty nice.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.