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. Need an idea

Need an idea

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 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.
  • U Offline
    U Offline
    User 378
    wrote on last edited by
    #1

    Hello.... I have to write an application that can load one image and let the user draw on it two lines: the application must tell the user the degree among the two lines. Can You help me????? Thanks

    E 1 Reply Last reply
    0
    • U User 378

      Hello.... I have to write an application that can load one image and let the user draw on it two lines: the application must tell the user the degree among the two lines. Can You help me????? Thanks

      E Offline
      E Offline
      Eddie Ng 0
      wrote on last edited by
      #2

      If you still remember high school trigonometry, this problem is easy to solve!! OK, here we go.. Let the endpoint of the 1st line be (x1, y1) and (x2, y2) Let the endpoint of the 2nd line be (x3, y3) and (x4, y4). Let the slope of the 1st line be m1 and the 2nd line be m2. [the slope can be calculated by m1 = (y2 - y1)/(x2 - x1)]. Then the angle between the two lines is given by arctan[(m1 - m2)/(1 + m1*m2)]. Of course you have to deal with many other factors and boundary conditions, the type of coordinate system you're using, and convert radian to degree, etc... Hope this helps. Eddie

      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