VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Linear Interpolation

by Todd Wayman (8 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Thu 22nd March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Linear Interpolation

Rate Linear Interpolation



'* Start Comment Block  ***********************************
'* Generated using VB 3.0 ToolBar
'* Author: Todd Wayman
'* Date: Mar, 22, 2001
'* Version: 1.00
'* Copyright © 2001 Todd Wayman; All rights reserved.
'* Function Title: Linear Interpolation
' *************************************************************
'*
'* Disclaimer:
'*
'* This software is provided AS IS without warranty of any kind, either
'* express or implied. This includes without limitation the fitness for
'* a particular purpose or application and any warranties of merchantability.
'* The author shall not be liable for any damage, whether direct, indirect,
'* special, or consequential, arising from a failure of this software or
'* accompanying files to operate in a manner desired by the user. The author
'* shall not be liable for any damage to data or property which may be
'* caused directly or indirectly by the use of this program.
'* By using and/or installing this software YOU assume all responsibility.
'*
'* End Disclaimer
'*
'* Comments:
'* Function returns a value between two given numbers by a given percentage
'*
'* Usage:
'* Dim X
'*
'* X = Interpolation Lo, Hi, Percent
'*
'* Lo is the low end value
'* Hi is the high end value
'* Percent is the percentage (as a decimal value) to Interpolation
'*
'* Example:
'* X = Interpolation 1, 3, .33
'*
'* X = 1.66
'*
'* VB 3.0 or greater
'*
'* End Comment Block  *************************************

On Error GoTo Exit_Interpolation:
    'Linear Interpolation Equaton
    Interpolation = (Val(Lo)) + (Abs(Val(Hi) - Val(Lo)) * (Val(Percent) - Int(Val(Percent))))
Exit Function
Exit_Interpolation:
Exit Function
End Function


Download this snippet    Add to My Saved Code

Linear Interpolation Comments

No comments have been posted about Linear Interpolation. Why not be the first to post a comment about Linear Interpolation.

Post your comment

Subject:
Message:
0/1000 characters