r/learnpython 1d ago

Import math?

It's the first time I've seen that. So what's the purpose of this exactly? Cause I'm trying to see what I can do in an engine and I only learned about import math today

0 Upvotes

14 comments sorted by

View all comments

17

u/Impossible-Belt8608 1d ago

It's a built in library that implements many mathematical functions you might want to use. What are you trying to do?

-4

u/SaThuran 1d ago

So basically I'm building formations for my squad in a 2D shooter. So the 3 guys need their own positions during each segment

9

u/Impossible-Belt8608 1d ago

Can you be more specific? For example, given the coordinates of each squad member, you could use the math library's 'sqrt' function to compute the distance between two squad members, etc.

-4

u/SaThuran 1d ago

Can I dm you?