danger/u/
This thread is permanently archived
avoid scaling to 0

| in a nice way, i need it to not scale to 0 like basically normalized to a length...

all the ways.
because i also need to avoid things like ^2 or abs()

basically a linear equation that writes up nicely by avoiding those things.
https://imgur.com/a/770svnh


| Just don't scale it to 0, headass


| >>1023536 well my equation uses x and y coordinate multiplied and added with the h v position of the sprites, so x and y always scales to 0, buttface

I have found some solution actually but it is written ugly like dividing it by abs(x)+abs(y)
So I want something alike but not written as such

Any idea, professor????


| If x == 0
x == 1
If y == 0
y == 1

:3


| >>1023673 p.cool, but i'd like to avoid if else.


| >>1023821 okay fine, here's a real answer.

Consider adding a constant to x and y before multiplying or adding.

epsilon = 1e-6 # A small constant
x_scaled = (x + epsilon) * h
y_scaled = (y + epsilon) * v

Consider clamp values

x = max(x, epsilon)
y = max(y, epsilon)

Consider scale, offset, or both

scale_factor = 0.5 # Example scale factor
x_scaled = (x * scale_factor + offset) * h
y_scaled = (y * scale_factor + offset) * v

Meow meow meow meow meow meow


| >>1023855 ... i think i saw this when asking chat gpt...problem is that it is ugly as hell
can i have other alternative that avoids
>if else
>epsilons
>sqrt, **2,^
> < or < = symbols or similarly
>max mins abs

basically only +, - and /

basically elementarriest solution you can find in linear algorythm...


| >>1023856 okay, add 0.01 to x and y when it's being declared


| >>1023673
x = (x == 0)? 1 : x;
y = (y == 0)? 1 : y;


| >>1023914 I also kinda need it to stop at a certain radius from the center

>>1024001 haven't tried this. Have you done it on tululoo?
My CPU is kinda jittery for test and tries...


| >>1024197
Scale from that radius being zero, rather than actual zero


| >>1024197
Unfortunately, I haven't tried it in tululoo.
but the "conditional operator" (<condition>) itself? <then> : <else> I've only seen in C.
But it seems to be in Java and JavaScript, the latter I believe is used in tululoo.


| >>1024206 i dont get this but this seems feasible. what do i do then?


| Eh I just wrote it not really understanding the replies or context of your statement. I’m imagining really a minimum size , and anything above that is the ‘size measurement’ which is what is actually scaled upon. It can be scaled to zero but the effect is not to actually zero out the object. This is probably hacky and not what you’re looking for. For instance, if objects interacted with are close to the minimum size, you’ll notice that things being doubled don’t change significantly


| I really struggle to understand your posts and the environment you’re working in unfortunately. And I’m not actually skilled in math or computer science, I just like to chime in on puzzles without really trying to understand what would probably take far too long for my easily distracted g/u/rl mind


| >>1024454 >>1024455 ...having hard time getting it but i guess i got the gist...
point is i multiplied the x to h and y to v, add those, and then y to h and x to v... subtract them, and assigned to thex and y you get either clockwise or counter clockwise rotation.. and both x and y all has 0, so how do you not 0 it out then. i guess the limit is r, but r is either + or - so it needs length but i m looking to minimize the funny symbols..

Total number of posts: 16, last modified on: Fri Jan 1 00:00:00 1724049864

This thread is permanently archived