Slight polar projection with offset issue

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:
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.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top