Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# Convert 1 range to another

public float ConvertRange(float value, float range1Min, float range1Max, float range2Min, float range2Max) {
        if (range1Min == range1Max) return value;
        return ((value - range1Min) * (range2Max - range2Min) / (range1Max - range1Min)) + range2Min;
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: double parse csharp removes decimal 
Csharp :: c# console delete last character 
Csharp :: substring in c# 
Csharp :: aspx receive variable from url 
Csharp :: sharepoint c# get list item query by lookup 
Csharp :: nunit cleanup after all tests 
Csharp :: c# read excel file into datatable 
Csharp :: decimal operator in Convert.toDouble() C# 
Csharp :: linq from list c# 
Csharp :: monogame print debug 
Csharp :: Convert DataTable to excel file c# using epplus 
Csharp :: save position unity 
Csharp :: unity reload active scene 
Csharp :: unity apply bloom of a different color 
Csharp :: spiral matrix 
Csharp :: invalidoperationexception c# ui thread 
Csharp :: web client ignore ssl error 
Csharp :: unity get distance between line and point 
Csharp :: c# asp.net hover tooltip 
Csharp :: unity stop object from rotating 
Csharp :: system.drawing.color to system.consolecolor 
Csharp :: DataGridView ComboBox column selection changed event 
Csharp :: enum in combobox wpf 
Csharp :: select top 5 in linq c# 
Csharp :: c# how to make object rotate forever 
Csharp :: how to convert int to string c# 
Csharp :: Using Linq to get the last N elements of a collection? C# 
Csharp :: dbset properties 
Csharp :: datatable select c# 
Csharp :: lightbox 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =