It is currently April 28th, 2024, 6:55 am

Rounding errors?

Get help with creating, editing & fixing problems with skins
PandaFace
Posts: 3
Joined: May 27th, 2012, 10:13 am

Rounding errors?

Post by PandaFace »

im trying to make a series of objects rotate in an oval, which i can do using X,Y coordinates and some trig. my problem is that to do so i need theta, the angle that each obect is at at any point so i can find out where it has to be next. im trying to do this by measuring the time in seconds (0-59) then converting that into radians, so it takes a minute for one full rotation. unfortunately the calc function only ever gives me how many radians it is in 0dp, ie it just gives me an integer and no decimals. here is my code:

Code: Select all

[rads1]
Measure=calc
Formula=((MeasureTime+1)*6*PI)/180
Any help would be much appreciated!
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Rounding errors?

Post by Mordasius »

PandaFace wrote:.. unfortunately the calc function only ever gives me how many radians it is in 0dp, ie it just gives me an integer and no decimals.
I think the problem could be in how you are trying to use or display the value. The [rads1] calc measure is calculating something and the string meter [MeterShowRads1] shows the answer to 16 dp.

Code: Select all

[MeasureTime]
Measure=Time
Format=%S

[rads1]
Measure=calc
Formula=((MeasureTime+1)*6*PI)/180

[MeterShowRads1]
Meter=STRING
MeasureName=rads1
FontColor=eeeeee
FontSize=24
AntiAlias=1
NumOfDecimals=16
User avatar
YGKtech
Posts: 22
Joined: December 30th, 2011, 1:03 am
Location: Minneapolis, Minnesota, USA

Re: Rounding errors?

Post by YGKtech »

I have literally no idea if this will help, but try changing the numbers in your equation to floating point numbers

[rads1]
Measure=calc
Formula=((MeasureTime+1)*6.0*PI)/180.0

there is a chance this will cause rainmeter to type-cast the equation to a floating point number, and solve the problem.