📌  相关文章
📜  在两个范围之间缩放 c# 代码示例

📅  最后修改于: 2022-03-11 14:49:17.791000             🧑  作者: Mango

代码示例1
public float scale(float OldMin, float OldMax, float NewMin, float NewMax, float OldValue){
 
    float OldRange = (OldMax - OldMin);
    float NewRange = (NewMax - NewMin);
    float NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin;
 
    return(NewValue);
}