Picwin Formulas and tools

By sercan386 on Feb 24, 2009

These identifiers are my solution for degree and length-related problems in picwins. If you use it, please credit me, it was a true brainfuck. Here's what they do:

  • $length requires 4 parameters: point 1 x, point 1 y, point 2 x, point 2 y. It calculates the distance between those points.
  • $GetPoint requires 4 parameters: starting x, starting y, degrees, distance. It finds the point in the picwin that is located at the distance and degree of the starting point. It returns both the X and Y !!!!
  • $GetAngle1 calculates the direction of point 2 seen from point 1. So, if point 2 is right above point 1 the angle will be 0. Requires 4 parameters: Point 1 x, point 1 y, point 2 x, point 2 y.
  • $GetAngle2 calculates the angle between 3 points !!!!!!!!! YAY. It returns the angle of point 1. Parameters: Point 1 x, point 1 y, point 2 x, point 2 y, Point 3 x, point 3 y.
alias length return $sqrt($calc(($1 - $3) ^2 + ($2 - $4) ^2))
alias getpoint return $calc($1 + $sin($calc($3)).deg * $4) $calc($2 - $cos($calc($3)).deg * $4)
alias GetAngle1 return $atan($calc(($3 - $1) / ($4 - $2))).deg
alias GetAngle2 return $abs($calc($getangle1($1 , $2 , $3 , $4) - $getangle1( $1 , $2 , $5 , $6)))

Comments

Sign in to comment.
knoeki   -  Feb 25, 2009

whats midpoint?

assuming I understand it correctly, it would be the center of the 4 co-ords you specify...

or somehting like that.

 Respond  
sercan386   -  Feb 25, 2009

whats midpoint?

 Respond  
Firstmate   -  Feb 24, 2009

Get some 3d transformation identifiers. Those are helpful.
Maybe some situation-specific ones, like identifiers for Clocks and stuff

 Respond  
Kirby   -  Feb 24, 2009

How about midpoint? (just wondering)

 Respond  
sercan386   -  Feb 24, 2009

Sorry for my bad English but I hope this will coe in useful :)
I know there is a thing similar to GetAngle2 but I think this one is more efficient.

 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.