Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problems with PI

Problems with PI

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomgraphicsgame-devhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeryth
    wrote on last edited by
    #1

    So I've got a DirectX Project that rotates some polys around. My problem is that I get compile errors saying PI is an undeclared indentifier. I've got the #include cmath statement ( BTW anyone know how to get the <> brackets to show up in code statements? ) and if I hover the cursor over a PI anywhere I get a tooltip "#define PI 3.14159...." Any idea what the problem is? The question "Do computers think?" is the same as "Can submarines swim?" DragonFire Software Jeryth

    K 1 Reply Last reply
    0
    • J Jeryth

      So I've got a DirectX Project that rotates some polys around. My problem is that I get compile errors saying PI is an undeclared indentifier. I've got the #include cmath statement ( BTW anyone know how to get the <> brackets to show up in code statements? ) and if I hover the cursor over a PI anywhere I get a tooltip "#define PI 3.14159...." Any idea what the problem is? The question "Do computers think?" is the same as "Can submarines swim?" DragonFire Software Jeryth

      K Offline
      K Offline
      Kevin McFarlane
      wrote on last edited by
      #2

      Not sure why your code won't compile. However, how about using this expression for defining pi? const double PI = 4 * atan(1.0); Kevin

      A 1 Reply Last reply
      0
      • K Kevin McFarlane

        Not sure why your code won't compile. However, how about using this expression for defining pi? const double PI = 4 * atan(1.0); Kevin

        A Offline
        A Offline
        Antti Keskinen
        wrote on last edited by
        #3

        And to get the bracets show in these messages, use their HTML escape sequence codes. For > it is "& + gt;" and for < it is "& + lt;" (Remove the + sign, the quotes and write the entire sequence togeter in order to actual display it) -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups