Jump to content

Search the Community

Showing results for tags 'atn'.

• Search By Tags

Type tags separated by commas.

Forums

• CADTutor
• News, Announcements & FAQ
• Feedback
• AutoCAD
• AutoCAD Beginners' Area
• AutoCAD 2D Drafting, Object Properties & Interface
• AutoCAD Drawing Management & Output
• AutoCAD 3D Modelling & Rendering
• AutoCAD Vertical Products
• AutoCAD LT
• CAD Management
• AutoCAD Bugs, Error Messages & Quirks
• AutoCAD General
• AutoCAD Blogs
• AutoCAD Customization
• The CUI, Hatches, Linetypes, Scripts & Macros
• AutoLISP, Visual LISP & DCL
• .NET, ObjectARX & VBA
• Application Beta Testing
• Application Archive
• Other Autodesk Products
• Autodesk 3ds Max
• Autodesk Revit
• Autodesk Inventor
• Autodesk Software General
• Other CAD Products
• BricsCAD
• SketchUp
• Rhino
• SolidWorks
• MicroStation
• Design Software
• Catch All
• Resources
• Tutorials & Tips'n'Tricks
• AutoCAD Museum
• Blocks, Images, Models & Materials
• Useful Links
• Community
• Introduce Yourself
• Showcase
• Work In Progress
• Jobs & Training
• Chat
• Competitions

Categories

• Programs and Scripts
• 2D AutoCAD Blocks
• 3D AutoCAD Blocks
• Images
• Backgrounds

Found 1 result

1. can't get coordinates straight

I have set in autocad the correct angle settings, have been applying 20 different functions to obtain the correct angle (Y axis) between two coordinates, but I keep getting strange angles back from this routine. Either the correct angle is difference with 90, or 450. Any idea why? I have gone through most of math forums on the internet. I need the angle correctly in order to scale a polygon. thanks. Public Function GiveAngle(DegRad As Boolean, x1 As Double, y1 As Double, x2 As Double, y2 As Double) As Double Dim Xdist, Ydist As Double Dim ATAN3 As Double Dim PI As Double PI = 3.14159265358979 Xdist = (x2 - x1) Ydist = (y2 - y1) If Abs(Ydist) > Abs(Xdist) Then If Ydist > 0 Then ATAN3 = Math.Atn((x2 - x1) / (y1 - y2)) Else ATAN3 = Math.Atn((x2 - x1) / (y1 - y2)) + PI End If Else If Xdist > 0 Then ATAN3 = 0.5 * PI - Atn((x2 - x1) / (y1 - y2)) Else ATAN3 = -0.5 * PI - Atn((x2 - x1) / (y1 - y2)) End If End If GiveAngle = ATAN3 * 180 / PI End Function
×
×
• Create New...