Last active
September 7, 2021 04:50
-
-
Save JohnForbes/7130661 to your computer and use it in GitHub Desktop.
Interpolation Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bituAsphHueMax = 100 | |
| bituAsphHueMean = 50 | |
| bituAsphHueMin = 0 | |
| bituAsphLumMax = 100 | |
| bituAsphLumMean = 50 | |
| bituAsphLumMin = 0 | |
| bituAsphSatMax = 100 | |
| bituAsphSatMean = 50 | |
| bituAsphSatMin = 0 | |
| brickPavHueMax = 100 | |
| brickPavHueMean = 50 | |
| brickPavHueMin = 0 | |
| brickPavLumMax = 100 | |
| brickPavLumMean = 50 | |
| brickPavLumMin = 0 | |
| brickPavSatMax = 100 | |
| brickPavSatMean = 50 | |
| brickPavSatMin = 0 | |
| concreteHueMax = 100 | |
| concreteHueMean = 50 | |
| concreteHueMin = 0 | |
| concreteLumMax = 100 | |
| concreteLumMean = 50 | |
| concreteLumMin = 0 | |
| concreteSatMax = 100 | |
| concreteSatMean = 50 | |
| concreteSatMin = 0 | |
| grassTurfHueMax = 100 | |
| grassTurfHueMean = 50 | |
| grassTurfHueMin = 0 | |
| grassTurfLumMax = 100 | |
| grassTurfLumMean = 50 | |
| grassTurfLumMin = 0 | |
| grassTurfSatMax = 100 | |
| grassTurfSatMean = 50 | |
| grassTurfSatMin = 0 | |
| hue = 20 | |
| sat = 30 | |
| lum = 40 | |
| def interpolate(x,xmin,xmax,ymin,ymax): | |
| return ymin+(ymax-ymin)*((x-xmin)/(xmax-xmin)) | |
| print interpolate(0,1,0,1,0.5) | |
| def distance3d(xa,ya,za,xb,yb,zb): | |
| return ((xb-xa)**2 + (yb-ya)**2 + (zb-za)**2)**0.5 | |
| def distance2d(xa,ya,xb,yb): | |
| return ((xb-xa)**2 + (yb-ya)**2)**0.5 | |
| print distance2d(0,0,1,1) | |
| jimmyD = distance2d(hue,sat,grassTurfHueMean,grassTurfLumMean) | |
| print interpolate(jimmyD,grassTurfHueMin,grassTurfHueMean,0,1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment