Where do I put the file with my auxiliary functions?

I’m working on a small project to get used to C++ in the unreal engine and I’ve gotten to the point where a few of my game objects need access to a small math function that I want to store in an auxiliary file. My problem is that neither XCode nor the editor are allowing me to place folders in the “Source/MyProject6” folder, which means that I would have to create this file in the same folder as all of my game classes which feels like bad practice(that folder will inevitably be insanely cluttered with things that I won’t need to access that often). Am I missing an option or is there somewhere else that the engine wants me to place my own modules that will be accessed by multiple objects?

To be more specific in case it matters: My “grid” that is used to create a 2d world of blocks is stored in a 1D TArray, and I need a place to store the function that, when given an iterator and the width of the array, returns an X,Y coordinate of the value. I know that this function and a few others will need to be accessed by multiple classes, so how do I make it available to them in a way that is appropriate in scope, fast, and well organized.

This is also my first post so let me know if its in the wrong section or too specific/not specific enough.

Maybe just a <YourProject>_Utils class with the function as a static method? Keeps it pretty clean.

If you want to use those functions in Blueprints too, you might want to put them into your own UBlueprintFunctionLibrary class.

Does that mean even when you use the “Add New -> New C++ Class” option in the Unreal Editor and edit the Path field you aren’t able to specify a subfolder under the source folder?
Alterantively you could try to manually create a new folder in the “explorer” and then regenerate project files.

I wasn’t even thinking about using a class in the editor. Your solutions made several things click for me here, and I’m able to place the class in a subfolder by manually setting the path. Is there a way to mark this resolved?