Calculating angles

Discussion in 'AutoCAD' started by ajtruckle, Nov 15, 2004.

  1. ajtruckle

    ajtruckle Guest

    I am using the PolarPoint method:

    endPoint = ThisDrawing.Utility.PolarPoint( _
    objCoord, dPolarRotate, dPolarDistance)

    I have come to the situation where I know the 3 lengths of my triangle (90 degrees triange) and want to work out the longest sides angle so that I can use it with PolarPoint. How do I calculate the angle? The arcsin derived idea on the VBA help is not foolproof and crashes for certain angles.

    Thanks.
     
    ajtruckle, Nov 15, 2004
    #1
  2. ajtruckle

    ajtruckle Guest

    I decided to use two PolrPoint methods to mimic the lines of the rectangle. I end up with the coordinate I need.

    This is good enough for me.
     
    ajtruckle, Nov 15, 2004
    #2
  3. Just to tie up a loose thread, the derived function in the help file is:
    Arcsin(X) = Atn(X / Sqr(-X * X + 1))

    It will crash when X=1 or X=-1. To make it work you would wrap it in an
    IF-THEN to catch these cases, such as:

    Dim asin as double
    const PI = 3.1415 'approximate
    If X = 1 then
    asin = PI / 2 '90 degrees
    elseif X = -1 then
    asin = 3 * PI / 2 '270 degrees or -90deg
    else
    asin = Atn(X / Sqr(-X * X + 1))
    endif

    James


    degrees triange) and want to work out the longest sides angle so that I can
    use it with PolarPoint. How do I calculate the angle? The arcsin derived
    idea on the VBA help is not foolproof and crashes for certain angles.
     
    James Belshan, Nov 15, 2004
    #3
  4. ajtruckle

    wivory Guest

    In addition, Arcsin is undefined for any values of X outside ±1, so you may want an extra clause such as:

    ElseIf X < -1 Or X > 1 Then
    MsgBox X & " is outside the pure mathematical definition of Arcsin"

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Nov 16, 2004
    #4
  5. ajtruckle

    ajtruckle Guest

    Why doesn't someone just define some decent derived methods, like a good working arcsin and make them available for users to download?

    Andrew
     
    ajtruckle, Nov 16, 2004
    #5
  6. Hi Andrew,

    I've been on a large number of sites on the web where this type of data is
    published for free download. Maths text books are full of it and when I
    went to school you would have been locked at about year 10 maths until such
    time as you could do it yourself.

    Before complaining you should have done a web search.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au

    working arcsin and make them available for users to download?
     
    Laurie Comerford, Nov 16, 2004
    #6
  7. ajtruckle

    ajtruckle Guest

    I was not complainign as such. And please trust me, I did a websearch about asin.

    You must appreciate I am not a mathematical wizard and I did not do trigonometry at school. The webpages that I found showed stuff I did not understand.

    What I was getting at is this:

    Autodesk go to the trouble of providing a help topic showing a derived method for arcsin (as I already find myself by doing searching through help topics :) ). But it would have been nice to show a fully working derivation and not just a snippet that by itself is not good enough.

    That was all.

    But please, I check websites alot and serach engines, so don't mis-construe what I was saying.
     
    ajtruckle, Nov 16, 2004
    #7
  8. ajtruckle

    wivory Guest

    In fairness to Autodesk, if you're going to blame anyone then blame Microsoft because they provided the Visual Basic engine used in AutoCAD along with the half-baked arcsin example.

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Nov 18, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.