Calculating a Tangent to a Curve
- Updated2024-09-12
- 2 minute(s) read
(Version 10.2 | Viewing and Editing Data) > Calculating a Tangent to a Curve
Calculating a Tangent to a Curve |
This example calculates a straight line between the corner points of a frame cursor. If you make the frame cursor very narrow, the straight line is the tangent to the curve. In the tooltip, DIAdem shows the gradient as a dy/dx value.
The script file TangentCursor_Init.vbs registers a user command that calculates a diagonal between the corners of the frame cursor, in relation to the current cursor positions. The user command saves the calculated data in a new channel pair and displays this data as a straight line in DIAdem VIEW.
Start example
Click a filename to load this file into DIAdem.
TangentCursor_Init.vbs | Script file |
TangentCursor_Event.vbs | Script file with user command |
Example_data.tdm | Data file |
TangentCursor.tdv | Layout file |
![]() | Note° When this example starts, DIAdem loads example files and overwrites existing data and layouts. |
![]() |
Note You only can load the layout file TangentCursor.tdv without errors if you have registered the user command. |
![]() | Note To reset the event OnCursorChanged click here. DIAdem sets the View.Events.OnCursorChanged property to the default value. |
![]() | Note In this example DIAdem registers the user command file TangentCursor_Event.vbs. If you do not save the program settings when you exit DIAdem, the user commands contained in the program settings are not available when you start DIAdem again until you restart the example. |
Procedures
Defining User Commands and Global Variables | Using User Commands