# How to ask better algorithm/computation questions?

Sometimes I come to this site when I have a (usually geometric) programming problem that involves math, like testing the orientation of a spherical polygon. That question got an answer, but it was a really vague and brief answer that while probably mathematically sound didn’t actually help much when implementing an actual computable procedure for it.

Project the vertices on a unit cube centered on the sphere to get a polyhedron. This takes Euclidean norms of vectors, but no trigonometry.

Then you compute the signed volume by the shoelace formula generalized to 3D.

I know people don’t have to answer my questions at all, and I’m grateful to have gotten at least some help on my problem, but for someone who isn’t a math expert, and just needs it to solve a programming problem, answers like that kind of remind me of the draw an owl meme.

It seemed like the answerer didn’t really understand that the reason I wanted a method that didn’t involve trig functions isn’t because I wanted to see if there exists some way to do without them, but because acos() and asin() are slow. And suggestions like “find the intersections with the circumscribed cube and integrate by method of vertical prisms” aren’t really useful to me in that context.

How can I ask questions in a way that the answers will be more useful for the problem I’m actually working on? I’m worried saying outright “the answer needs to be numerically stable and more efficient than the naive approach” would be inappropriate for Math.SE, but at the same time the answers I’m getting right now aren’t very helpful.

Again, I’m not complaining about people who took time out of their day to help me with my problem, I just want to know how to ask for solutions that translate into useful code.

• Nowhere in the question you posted, nor in the comments you have since posted, did you say anything resembling "I want solutions that translate into useful code". If you want an answer that you will find useful, you have to ask the question that you actually want answered. If the answerer doesn't understand your reasons, is that the fault of the answerer, or does it mean you haven't worked hard enough to explain your reasons? We're good mathematicians here, but we're not mindreaders. – Gerry Myerson Jun 29 '18 at 0:10
• @GerryMyerson well I said I was doing point-in-polygon so I figured it was implied. should I accept the answer and ask a new question or do the delete/undelete thing – taylor swift Jun 29 '18 at 0:11
• Up to you, BUT if you delete/edit/undelete then be sure to include something in the edit about how the posted answers were to an earlier version of the question (you don't want to make it look like the answerers deliberately misunderstood your question), and if you ask a new question then be sure to link each question to the other one and to explain in the new question precisely how it differes from the original. – Gerry Myerson Jun 29 '18 at 3:00
• Goto Code Review and ask a performance question? Or Stack Overflow? Here you can ask for the algorithm with lowest asymptotic complexity but not actual implementation performance. – user202729 Jun 30 '18 at 13:17
• The more you assume we know, the fewer of us will understand your question and the more likely it is that their answer, even if it is correct, will help you. – steven gregory Jul 3 '18 at 2:35
• If you're looking for algorithms, Computer Science is probably more appropriate. (But note that anything involving actual coding is off-topic, there.) – David Richerby Jul 4 '18 at 18:11