Einzelnen Beitrag anzeigen

Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.606 Beiträge
 
#12

AW: Programme bzw. Funktionen von KI schreiben lassen (OpenAI)

  Alt 15. Dez 2022, 10:35
Interessant wäre es mal eine richtige Frage zu stellen.
Ala : "Write a function in Delphi pascal that adds two sinus waves, with a given frequency and an frequency offset of 3% between both"
Bittesehr:

Zitat von ChatGPT:
Here is an example of a function that adds two sinus waves in Delphi Pascal with a given frequency and an offset of 3%:
Code:
function AddSinusWaves(freq: Real; offset: Real): Real;
begin
  Result := Sin(freq * 2 * Pi) + Sin(freq * (1 + offset) * 2 * Pi);
end;
To use this function, you can call it with two arguments: the frequency of the first sinus wave and the offset between the two waves. For example:
Code:
result := AddSinusWaves(10, 0.03);
This would add two sinus waves with a frequency of 10 Hz, with the second wave having an offset of 3% relative to the first wave. The result of the function is the sum of the two sinus waves.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat