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. Visual Basic
  4. minor math question

minor math question

Scheduled Pinned Locked Moved Visual Basic
data-structuresquestionlounge
4 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.
  • C Offline
    C Offline
    crash893
    wrote on last edited by
    #1

    Hi all, I was wondering if anyone knew of a relatively easy way to draw a random line through a value of X on a graph. I then need to pull two points from the line. None of this needs to be graphical or even displayed i just need the points as text output to be use later. Any ideas at all would be greatly appreciated.

    G 1 Reply Last reply
    0
    • C crash893

      Hi all, I was wondering if anyone knew of a relatively easy way to draw a random line through a value of X on a graph. I then need to pull two points from the line. None of this needs to be graphical or even displayed i just need the points as text output to be use later. Any ideas at all would be greatly appreciated.

      G Offline
      G Offline
      GgAben
      wrote on last edited by
      #2

      Use random numbers Dim rnd As Random s = rnd.Next()

      Gg

      C 1 Reply Last reply
      0
      • G GgAben

        Use random numbers Dim rnd As Random s = rnd.Next()

        Gg

        C Offline
        C Offline
        crash893
        wrote on last edited by
        #3

        thats not exactly what I meant I'm not looking for truly random numbers I'm looking for 2+ random points on a line that intersects x at a given point

        T 1 Reply Last reply
        0
        • C crash893

          thats not exactly what I meant I'm not looking for truly random numbers I'm looking for 2+ random points on a line that intersects x at a given point

          T Offline
          T Offline
          The ANZAC
          wrote on last edited by
          #4

          If you generate the equation of the line, you can sub x values back in and calcualte y values. e.g. y = x + 2 Say x = 2 y = (2) + 2 y = 4 Therefore the point = (2,2) Looks easy on paper, yet i imagine it's somewhat more difficult to accomplish in code. Hope this gets you started.

          Posted by The ANZAC

          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