88293

Drawing lines at angle vb.net [closed]

Question:

I can find plenty of examples of how to draw a line in vb.net online.

I however I cannot find any examples of how to draw lines at a specific angle.

Could someone tell me how to do this?

Answer1:

You'll need to do a bit of math using sin/cos.

x1, y1 = starting position of line<br />angleInRadians = angle on the line converted to Radians

x2 = lineLength * Math.Cos(angleInRadians) + x1 y2 = lineLength * Math.Sin(angleInRadians) + y1

Then you can draw a line from (x1, y1) to (x2, y2).

Recommend

  • Calling $window.print() in angularjs causes the print preview to show a blank page
  • Prediction using a natural spline fit
  • How to get a path to resources?
  • Rails: Converting from MySQL to PostGres breaks Geokit Distance Calculations?
  • Geometry shader doesn't do anything when fed GL_POINTS
  • Getting Coordinates of a Point in a circle
  • uninitialized AudioTrack exception when I try to generate tone on 22nd time
  • How to setCenter mapview with location in google maps sdk for iOS
  • Serial communication over USB converter in Python - how to aproach this?
  • Python sin and cosine giving incorrect values
  • Memory dump much smaller than available memory
  • Recreate Apple Watch fitness tracker ‘progress’ bar - gradient on CAShapeLayer stroke
  • Get or convert Week of year to ISO week
  • How to distribute Java-based software?
  • How can I use a custom function within an expression using the eval dataframe method?
  • How do I generate a Sine Sweep in Java (Android)
  • Correctly Importing Apache Commons Math Package
  • How to create a 2D image by rotating 1D vector of numbers around its center element?
  • Possible to “watch” both HAML and SASS at the same time?
  • C# fibonacci function returning errors
  • SAVE attribute needed for Fortran variables when only the C_LOC address is returned to a C program?
  • D3 get axis values on zoom event
  • PHP buffered output depending on server setting?
  • Allowing both email and username for authentication
  • R - Combining Columns to String Based on Logical Match
  • Get one-time binding to work for ng-if
  • Read text file and split every line in MSBuild
  • How to draw moving and Running sine wave chart using JFree chart in java?
  • Javascript + PHP Encryption with pidCrypt
  • How do you troubleshoot character encoding problems?
  • Return words with double consecutive letters
  • how to add data labels for bar graph in matlab
  • Matrix multiplication with MKL
  • Buffer size for converting unsigned long to string
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • What are the advantages and disadvantages of reading an entire file into a single String as opposed
  • Qt: Run a script BEFORE make
  • Django query for large number of relationships
  • Converting MP3 duration time
  • Conditional In-Line CSS for IE and Others?