Author Topic: get the radius of any given point  (Read 1353 times)

0 Members and 1 Guest are viewing this topic.

sysuwzx

  • Mosquito
  • Posts: 18
get the radius of any given point
« on: March 31, 2016, 03:03:33 AM »
Now one lwpolyline, part of it is straight line and part is arc. I want to get the radius of any given point. Using vlax-curve-getFirstDeriv, i can get the raidus of the arc parts. But if the point is on the staright line part, the value it returns does not make me understood.
Obviously, the radius of a straight line is +∞。And the vlax-curve-getFirstDeriv does not return this value.

ribarm

  • Gator
  • Posts: 3309
  • Marko Ribar, architect
Re: get the radius of any given point
« Reply #1 on: March 31, 2016, 04:10:32 AM »
You are writing as like you're thinking of vlax-curve-getSecondDeriv function...
(vlax-curve-getFirstDeriv should return vector of tangent on curve at specified parameter that relates to checking point on that curve)
Click on them to see their help info :

Code - Auto/Visual Lisp: [Select]
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: get the radius of any given point
« Reply #2 on: March 31, 2016, 05:34:53 AM »
For a line or linear polyline segment, the magnitude of the 1st derivative vector is equal to the length of the line or segment, and the magnitude of the 2nd derivative vector is zero (as there is no change in curvature); for circles, arcs or arc segments, the magnitude of the 1st & 2nd derivative vectors is equal to the radius.

sysuwzx

  • Mosquito
  • Posts: 18
Re: get the radius of any given point
« Reply #3 on: March 31, 2016, 07:01:27 AM »
Thanks Lee~ I did not understand what i find on the help document before and now i know it! I should have understand these functions better!

sysuwzx

  • Mosquito
  • Posts: 18
Re: get the radius of any given point
« Reply #4 on: March 31, 2016, 07:02:29 AM »
You are writing as like you're thinking of vlax-curve-getSecondDeriv function...
(vlax-curve-getFirstDeriv should return vector of tangent on curve at specified parameter that relates to checking point on that curve)
Click on them to see their help info :

Code - Auto/Visual Lisp: [Select]

thanks!