It is currently May 11th, 2024, 2:32 am

in lieu of "while"...

Get help with creating, editing & fixing problems with skins
D_Reckoning
Posts: 10
Joined: July 14th, 2010, 10:15 pm

in lieu of "while"...

Post by D_Reckoning »

So, from what I've been able to gather, rainmeter does in no way support loops... which has now put me in a bit of an iffy situation:

I've got a value, E0.

I've got a formula for calculating another value, E1.

My problem is that the formula for E1 needs to be itterated(repeated) untill the two values are within 0.001 of eachother.

As I'm sure you can see, this will be rather troubling to achieve without a loop (I'd rather not risk the integrity of the equation by forcing a set number of itterations - and I've honestly got no clue how many it might take)... Why not just set E1 to E0 to begin with? I've honestly got no clue. I'm in WAY over my head mathematicly, but the algorithms I'm using are from a reliable source (http://stjarnhimlen.se/comp/ppcomp.html#19).

If anyone's got any ideas whatsoever on how to solve this, I'd be positively overjoyed. :D
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: in lieu of "while"...

Post by smurfier »

I'm gonna take a guess that you're working on calculating the current position of the planets?
What you could possibly do is have a measure that continually calculates the iteration and have another measure that test whether it's within the .001 range and disable the measure that does the iteration. It will only work if you have the measure that does the iteration set it's value to a variable. It will take a while to get the final values for the complete formula, but this is the only way I see having this work using only Rainmeter.
I've been working on a plugin to do this. Two problems, it's my first endeavor with c++, and I'm missing some crucial information in scaling the coordinates from AUs down to pixels.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
D_Reckoning
Posts: 10
Joined: July 14th, 2010, 10:15 pm

Re: in lieu of "while"...

Post by D_Reckoning »

Yeah, You've guessed correctly :)
Must admit, at the moment it looks like a somewhat hopeless endeavour... Though perhaps an extension / addon in c++, like you mention, woul help facilitating things a bit ^^
The AU to pixel conversion should be pretty arbitrary, I think... just set a max amount of pixels you want to spend, and make that the distance to your furthest object (probably pluto) - then calculate the relationship between that and the proper AU value, and use that formula for the rest :)

(Or do as I've intended - just calculate the angle, and use aestheticly pleasing measures instead of proper ones... to avoid excessive cluttering of the inner planets ;) )
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: in lieu of "while"...

Post by smurfier »

I was hoping to avoid using ratios in scaling from AU's to pixels. The only info I'm missing is how the initial data used is calculated.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .