Skip to content
Snippets Groups Projects
Commit 860613cf authored by Matikainen Aini Esteri's avatar Matikainen Aini Esteri
Browse files

1.

parent b121de75
No related branches found
No related tags found
No related merge requests found
......@@ -15,20 +15,29 @@ class tuulenHyytavyys
static async Task Main()
{
// Määritellään viikonpäivät
string[] viikonpaivat = { "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai", "Sunnuntai" };
// Määritellään aikaleimat (yksi jokaiselle viikonpäivälle klo 12:00 UTC)
string[] timeStamps = {
"2024-03-25T12:00:00Z", // Maanantai
"2024-03-26T12:00:00Z", // Tiistai
"2024-03-27T12:00:00Z", // Keskiviikko
"2024-03-28T12:00:00Z", // Torstai
"2024-03-29T12:00:00Z", // Perjantai
"2024-03-30T12:00:00Z", // Lauantai
"2024-03-31T12:00:00Z" // Sunnuntai
"2024-03-25T12:00:00Z",
"2024-03-26T12:00:00Z",
"2024-03-27T12:00:00Z",
"2024-03-28T12:00:00Z",
"2024-03-29T12:00:00Z",
"2024-03-30T12:00:00Z",
"2024-03-31T12:00:00Z"
};
string place = "Jyväskylä";
string baseUrl =
try
{
using (HttpClient client = new HttpClient())
{
for (int i = 0; i < viikonpaivat.Length; i++) // käy läpi päivät ja aikaleimat
{
{
/// <summary>
/// ohjelma askee tuulen hyytävyyden käyttäen lämpötilaa, tuulennopeutta ja kosteutta
......@@ -37,10 +46,13 @@ static async Task Main()
/// <param name="nopeus">Tuulennopeus (m/s)</param>
/// <param name="kosteus">Suhteellinen ilmankosteus (%)</param>
/// <returns>Tuulen hyytävyyden indeksi (°C)</returns>
///
private static double Tuulenhyytavyyskaava(double lampotila, double nopeus, double kosteus)
{
// Tuulen hyytävyyden kaava
double tuulenhyytavyys = 13.12 + 0.6215 * lampotila - 11.37 * Math.Pow(nopeus, 0.16) + 0.3965 * Math.Pow(lampotila, 0.16) + (0.05 * kosteus);
return tuulenhyytavyys;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment