I'm trying to answer Compute rotation matrix using the magnetic field and my answer needs to use HTML because I need to show a table containing mathematics formulas. I've posted my answer here, however stackoverflow.com won't let me post it because it says that it's badly formatted code.

For Android I think the 3x3 rotation matrix is actually given by:

     (cosφ cosψ - sinφ sinψ sinθ)     sinφ cosθ     ( cosφ sinψ + sinφ cosψ sinθ)
    -(sinφ cosψ + cosφ sinψ sinθ)     cosφ cosθ     (-sinφ sinψ + cosφ cosψ sinθ)
              -sinψ cosθ                 -sinθ                  cosφ cosθ


    φ = azimuth
    θ = pitch
    ψ = roll

which corresponds to the 3x3 Android rotation matrix R[0] to R[8] via

    R[0] R[1] R[2]
    R[3] R[4] R[5]
    R[6] R[7] R[8]

Can this be fixed, is there a work-around?

Update 28-Mar-2013. I've attached an image to show the problem I encounter, because someone said that they don't get the problem when they try and post. If some people don't have the problem, is it because they have different rights/reputation etc compared to me?

enter image description here

Update2 28-Mar-2013: I typed in just a few lines (see below) and reproduced the problem (see image). I didn't enter any tabs. However, it took several minutes for the red box to come up telling me that my post appeared to contain code that's not properly formatted.

line before blank line


line after blank line

enter image description here

Update 3-Apr-2013: Today I was able to post the answer :-). Either there's been a fix released to stackoverflow.com, or it's because I've now got a higher reputation there and (as discussed in the comments below), the checks made probably vary depending on reputation.

  • 5
    Note: This user entered this report at my request, after trying to help them work around it several times. – Tim Post Mar 27 '13 at 16:37
  • I've copy/pasted the above on SO without any problem. @TimPost can you repro? – Sklivvz Mar 27 '13 at 17:33
  • I've updated the query to show the problem occurring! Is it possible that people with different rights/reputation don't encounter the problem? – Stochastically Mar 28 '13 at 13:16
  • @PaulDoust: Are there tabs in your paste? – Brian Mar 28 '13 at 13:18
  • @Sklivvz - Same, didn't reproduce. Something must be subtly different about what was posted here and what he's posting on SO? I can't trigger the same error he's getting. – Tim Post Mar 28 '13 at 13:29
  • @0A0D: no tabs. Also, I've just updated the question to show that I can reproduce the problem with a very small draft post. In case it helps, I'm running windows 7 professional (64 bit), and I get the problem with both Chrome and Internet explorer version 10. – Stochastically Mar 28 '13 at 14:21
  • @Stochastically: I can't reproduce your issue in the latest screenshot. I created an answer just like you did. Maybe there is a different filter because you are not a 10K+ user like me? – Brian Mar 28 '13 at 14:30
  • @0A0D, yes that's my best guess too. But even so, it's still a bug isn't it? Surely everything between <pre> and </pre> should be excluded from any formatted code checking, regardless of my reputation? – Stochastically Mar 28 '13 at 15:03
  • @Stochastically: Not sure why you are using the <pre> tags? – Brian Mar 28 '13 at 15:22
  • I wanted to do a table but that's not allowed, and the recommendation (see meta.stackexchange.com/questions/1777/… ) was to use <pre>. Also, I need html so that I can use greek letters via &#966 etc! – Stochastically Mar 28 '13 at 19:13

An alternative to using HTML is using Roger's Online Equation Editor that will return an image that you can insert into your question or answer (using LaTeX of course). Or you can try WolframAlpha.

  • Thanks, that's very helpful :-). – Stochastically Mar 28 '13 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .