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#
  4. point after rotate

point after rotate

Scheduled Pinned Locked Moved C#
csharpwinformsgraphicstutorialquestion
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.
  • T Offline
    T Offline
    Try
    wrote on last edited by
    #1

    I am using C#, GDI+. I have drawn the line (using DrawLine()) from point(10,10) to point(20,20). The center point of the line is (15,15). Suppose i Rotate At(10,10) the line for 30 degrees. How to calculate the center point after rotating?

    C 1 Reply Last reply
    0
    • T Try

      I am using C#, GDI+. I have drawn the line (using DrawLine()) from point(10,10) to point(20,20). The center point of the line is (15,15). Suppose i Rotate At(10,10) the line for 30 degrees. How to calculate the center point after rotating?

      C Offline
      C Offline
      CKnig
      wrote on last edited by
      #2

      For a line from (a_x,a_y) to (b_x,b_y) this is very simple. The center is always ( (a_x+b_x)/2, (a_y+b_y)/2 ) So either you have the new endpoints and use this formula or you apply your transformation to the old centerpoint (yes you can do this in .net)

      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