Atan2 math function

Changes made during the Rainmeter 3.2 beta cycle.

Re: Atan2 math function

I think you don't really understand what I ask : I (now) know how to draw every line I want, even vertical ones.

I just suggest you update the FIRST example of this thread for future people who would want to do the same thing, and will eventually don't understand why it does not work when X1=X2 because the actual solution is given further in the thread. I know it's only 3 post further but let's be practical and give a actually working guide at the begining.

Re: Atan2 math function

We'll have to see if JSMorley will make that change...

Re: Atan2 math function

If I'm not wrong eclectic-tech, mistic100 is not talking about jsmorley's initial code, but your initial code, with the supposed issue. Am I right mistic100?
If I am, here it is:

Code: Select all

`; This skin draws a center red point and draws lines to random secondary points every 3 seconds; Corrected to use different formula for LineLength and eliminate drawing error[Rainmeter]Update=3000BackgroundMode=2SkinWidth=312SkinHeight=180SolidColor=20,30,40,255[MeasureCounterX]Measure=CalcFormula=RandomUpdateRandom=1LowBound=156HighBound=156[MeasureCounterY]Measure=CalcFormula=RandomUpdateRandom=1LowBound=90HighBound=90[MeasureCounterX1]Measure=CalcFormula=RandomUpdateRandom=1LowBound=[MeasureCounterX]HighBound=[MeasureCounterX]DynamicVariables=1[MeasureCounterY1]Measure=CalcFormula=RandomUpdateRandom=1LowBound=20HighBound=170[MeterPointA]Meter=ImageX=[MeasureCounterX]Y=[MeasureCounterY]W=6H=6SolidColor=255,0,0,255DynamicVariables=1[MeterPointB]Meter=ImageX=[MeasureCounterX1]Y=[MeasureCounterY1]W=6H=6SolidColor=191,235,255,255DynamicVariables=1[MeterLineAtoB]Meter=RoundlineX=([MeterPointA:X]+([MeterPointA:W]/2))Y=([MeterPointA:Y]+([MeterPointA:H]/2))LineColor=255,255,255,255LineWidth=2LineLength=(([MeterPointB:X]-[MeterPointA:X])/Cos(Atan2([MeterPointB:Y]-[MeterPointA:Y], [MeterPointB:X]-[MeterPointA:X])))StartAngle=Rad(360)RotationAngle=(Atan2([MeterPointB:Y]-[MeterPointA:Y], [MeterPointB:X]-[MeterPointA:X]))AntiAlias=1DynamicVariables=1[MeterLabel]Meter=StringMeasureName=MeasureCounterX1MeasureName2=MeasureCounterY1FontColor=255,255,255Text=PointB: ( %1, %2 )`

Re: Atan2 math function

Sorry you are wrong, I am actually talking about @jsmorley code, which is, I repeat, the first thing people see, when reading this thread.

As you said earlier, @eclectic-tech already includes the fix.

Re: Atan2 math function

eclectic-tech wrote:We'll have to see if JSMorley will make that change...

I think I properly fixed the code blocks in the first post of the thread...

Thanks