Xorifelse
I'd love to elaborate about discussions...........
- Reaction score
- 87
Edit:
Figured it out, never mind.
I've ran multiple calculations but I'm not sure what is the right one, because every test seems to give me faulty results.
What I want a 2 functions to do is quite simple and you probably understand what I'm saying.
I don't want PolarProjectionOffsetX and PolarProjectionOffsetY return coordinates in the center of the center_x and center_y in range of the offset.
And of course there is a maximum range.
Example.
XXXXXXX
XYYYYYX
XYOOOYX
XYOCOYX
XYOOOYX
XYYYYYX
XXXXXXX
Legenda:
C > Center
O > Offset range
Y > Return range
X > Max range
In other words, return coordinates between the offset and the max range.
Could someone provide me with the mathematical expressions I need?
Currently, the functions returning the most accurately coordinates are:
However, both methods seem to ignore the offset.
Figured it out, never mind.
I've ran multiple calculations but I'm not sure what is the right one, because every test seems to give me faulty results.
What I want a 2 functions to do is quite simple and you probably understand what I'm saying.
I don't want PolarProjectionOffsetX and PolarProjectionOffsetY return coordinates in the center of the center_x and center_y in range of the offset.
And of course there is a maximum range.
Example.
XXXXXXX
XYYYYYX
XYOOOYX
XYOCOYX
XYOOOYX
XYYYYYX
XXXXXXX
Legenda:
C > Center
O > Offset range
Y > Return range
X > Max range
In other words, return coordinates between the offset and the max range.
Could someone provide me with the mathematical expressions I need?
Currently, the functions returning the most accurately coordinates are:
JASS:
private function PolarProjectionOffsetX takes real x, real min, real max returns real
return (x + min) + GetRandomReal( min, max ) * Cos( GetRandomReal( 0, 360 ) * bj_DEGTORAD )
endfunction
private function PolarProjectionOffsetY takes real y, real min, real max returns real
return (y + min) + GetRandomReal( min, max ) * Sin( GetRandomReal( 0, 360 ) * bj_DEGTORAD )
endfunction
JASS:
private function PolarProjectionOffsetX takes real x, real min, real max returns real
return x + GetRandomReal( min, max ) * Cos( GetRandomReal( 0, 360 ) * bj_DEGTORAD )
endfunction
private function PolarProjectionOffsetY takes real y, real min, real max returns real
return y + GetRandomReal( min, max ) * Sin( GetRandomReal( 0, 360 ) * bj_DEGTORAD )
endfunction
However, both methods seem to ignore the offset.