Finding the y position of the sun

I have written the following formula to calculate the x position of the sun and it works great! But I do not know how to calculate the y position, I would like it to be at -260 when it is directly in the middle and 0 at sunset or sunrise. Any ideas?

Sun x formula (I feel the gvs names are self explanatory, all time is in seconds):
$((gv(timesec) - gv(sunrise))/(gv(sunset) - gv(sunrise)) * 720)$

Basicallly you’d have to have 2 formulas, one if X<360, one if X>=360

<360 : -((260*X)/360)
>=360 : ((260*X)/360)-260

Where X is your own formula ofcourse

Note that this is a lineair rise in Y, while technically speaking it should be more of a parabole, but I think that will be hardly noticeable on your screen

Sorry I’m not very good with Kode… Am I missing something here @RonC?

` $<360 : -((260*gv(sunx))/360)

=360 : ((260*gv(sunx))/360)-260$ `

I refactored it into this but now when the sun is set it is at 260 instead of 0, where the sunrise is at 0 (what I want, 0.* formula.= 0)

I would make two text globals
Xpos
Ypos

Xpos is your formula

Ypos is:

$if(gv(Xpos)<360,-((260*X)/360),((260*X)/360)-260)$

And then use $gv(Xpos)$ and $gv(Ypos)$ in the coordinates of your sun graphic

Should work…
Let me know!

Thank you, this is what I ended up using, a few tweaks but it works

$if (gv(sunx) < 360, -((260 * gv(sunx))/360))$

$if(gv(sunx) >= 360, -((260* gv(sunx)/360)-520))$

Nice!
Could you post a screenshot of how it looks now?

I will when I finish it, right now I am struggling to find art for it, I’m not to sure where to look. Basically the goal is to build a wallpaper that would display the weather and time of day outside. I would make two versions and each would have the option to be animated, a realistic version and a clipart version. But I am struggling to find a good base image for the clipart one, because I want a mountain in the center of it (this would be the one I use so I want to start with this one) if you know a place where I could find images like the one below that would be amazing

1 Like

I was trying to transform the picture you have to a photo-realistic one by using AI, but no luck so far.

1 Like

Is this the image what you guys are looking for?

Dimension: 1,280px × 1,920px

I hope this would help.
:smiling_face::+1: