Getting wrong results in calculation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi friends,
I having some trouble with an autolisp routine. The concept is to draw steel profiles, I know theres a lot of them around the internet, but I want to write one by myself.
The problem is with decimal places, I read a lot of post about this and all say that visualisp will consider the maximum decimal even if I can't see that in variables, but the difference I found is exactly the difference caused by decimal places.
For example, Visualisp calculated values are:
#slope = 0.1645
#teta = 1.4063
#alfa = 1.7353
#beta = 0.703148
On calculator:
#slope = 0.16508381
#teta = 1.40571251
#alfa = 1.73588014
#beta = 0.70285626
In the attached file red line is hand made and the white section its autolisp with the routine. The real problem come when I try to make the bulge segments because they are not tangent since the slope segment has a different length than the expected. If you zoom in you will see a tiny space between red and white lines.
Thats the calculation I'm using:
#slope (atan (/ 166.6 1000))
#teta (- (dr 90) #slope)
#alfa (+ (dr 90) #slope)
#beta (/ #teta 2)
Temp.dwg - Steel section test
Estudos Angulos - Reference drawing to find geometric relations
Is there a way to fix this or a better approach?