advertisement

Find Code  Advanced Search   

Free Newsletters:   
browse free vb code
Submit Code
ASP,  HTML, and XML
Database
Dates  and Math
Files  and Directories
Forms  and Controls
Lists,  Collections, and Arrays
Miscellaneous
Multimedia/Games
Office/VBA
Network/Internet
Registry
Screen/Graphics
String  Manipulation
System/API
Windows  2000/XP
VB.NET/ASP.NET



advertisement
Calculate an Interpolated Value.

Author: Martin Wallace
Category: Dates and Math
Type: Snippets
Difficulty: Intermediate

Version Compatibility:  Visual Basic 5   Visual Basic 6  

More information: This function will return a linear interpolated value. See comments for further information. eg: *------------+-----* a c b 1 3 5 10 x 50 To find x at c the correct syntax would be: x = Interpolate(1,10,5,50,3) and the answer would be 30 Passing a value of true (default) for boolExtrapolate will switch on extropolation if findindex falls outside the bounds of index1 and index2.

This code has been viewed 66958 times.

Instructions: Copy the declarations and code below and paste directly into your VB project.


Declarations:

Code:

No Text Boxes

Sponsored Links