Skip to content

Commit 579cfeb

Browse files
authored
Merge pull request #128
feat: temperature converter
2 parents ee71c0d + 000ee91 commit 579cfeb

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

src/pages/tools/number/generic-calc/data/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import voltageDropInWire from './voltageDropInWire';
33
import sphereArea from './sphereArea';
44
import sphereVolume from './sphereVolume';
55
import slackline from './slackline';
6+
import temperatureConversion from './temperature';
7+
68
export default [
79
ohmslaw,
810
voltageDropInWire,
911
sphereArea,
1012
sphereVolume,
11-
slackline
13+
slackline,
14+
temperatureConversion
1215
];
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import type { GenericCalcType } from './types';
2+
3+
const temperatureConversion: GenericCalcType = {
4+
icon: 'carbon:temperature-inversion',
5+
keywords: ['temperature', 'conversion', 'celcius', 'fahrenheit', 'Kelvin'],
6+
shortDescription:
7+
'Convert temperatures between common scales like Celsius, Fahrenheit, Kelvin, and Rankine.',
8+
name: 'Temperature Converter',
9+
path: 'temperaure-conversion',
10+
description:
11+
'Convert temperatures between common scales like Celsius, Fahrenheit, Kelvin, and Rankine.',
12+
longDescription: `This calculator allows you to convert temperatures between Celsius, Fahrenheit, Kelvin, and Rankine. It is useful for scientists, engineers, students, and anyone needing to switch between these temperature scales for various applications.
13+
14+
Formulas Used:
15+
16+
Celsius (°C) ↔ Fahrenheit (°F):
17+
°F = (°C × 9/5) + 32, and °C = (°F - 32) × 5/9 ||
18+
19+
Celsius (°C) ↔ Kelvin (K):
20+
K = °C + 273.15, and °C = K - 273.15 ||
21+
22+
Celsius (°C) ↔ Rankine (°R):
23+
°R = (°C + 273.15) × 9/5, and °C = (°R - 491.67) × 5/9 ||
24+
25+
Kelvin (K) ↔ Fahrenheit (°F):
26+
°F = (K - 273.15) × 9/5 + 32, and K = (°F - 32) × 5/9 + 273.15 ||
27+
28+
Kelvin (K) ↔ Rankine (°R):
29+
°R = K × 9/5, and K = °R × 5/9`,
30+
formula: 'TdegC = (TdegF - 32) * 5/9',
31+
presets: [],
32+
variables: [
33+
{
34+
name: 'TdegC',
35+
title: 'Celsius',
36+
unit: 'tempC'
37+
},
38+
{
39+
name: 'TdegF',
40+
title: 'Farenheit',
41+
unit: 'tempF',
42+
default: 32,
43+
alternates: [
44+
{
45+
title: 'Kelvin',
46+
formula: 'x = (v -32) * 5/9 + 273.15',
47+
unit: 'tempK'
48+
},
49+
{
50+
title: 'Rankine',
51+
formula: 'x = v + 459.67',
52+
unit: 'tempR'
53+
}
54+
]
55+
}
56+
]
57+
};
58+
59+
export default temperatureConversion;

0 commit comments

Comments
 (0)