Math Help Needed, Im stuck trying to figure out exponential functions

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lofi

Im distributing X nodes from point A to point B in a linear way, more especifically like this.

var rotate.origin = 90
var rotate.ending = 180
var bullet.amount = 10.0

var rotate.angle = (rotate.ending - rotate.origin) / bullet.amount

In this case (180 - 90) / 10 = 9.

I’ll evenly spawn nodes with a diference of 9 degrees.

But I want to spawn them in a non linear way, going from small steps to bigger steps or viceversa, thats why i think an exponential function could help, but i don’t know how to apply it.

Can some one explain it to me?

:bust_in_silhouette: Reply From: Inces
for x in range(bullet.amount) :
      rotateangle /= 2

This will be pretty much exponential. If You are going to spawn bullets in forms of different functions, check out Curve2D. If not, just experiment with your calculations :wink:

thanks dude, that was easier than I thought, I Just want to add that the way rotate angle should be defined will be diferent.

rotate.angle = rotate.ending - rotate.origin

then your code snippet does the trick

for x in range(bullet.amount) :
      rotate.angle /= 2

lofi | 2021-03-27 09:53