Re: Division of two complex numbers

Liste des GroupesRevenir à s math 
Sujet : Re: Division of two complex numbers
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : sci.math
Date : 20. Jan 2025, 22:47:07
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vmmg8s$3e97a$5@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Mozilla Thunderbird
On 1/20/2025 1:36 PM, Moebius wrote:
Am 20.01.2025 um 22:28 schrieb Chris M. Thomasson:
On 1/20/2025 1:09 PM, Python wrote:
 
Again what's *your* point? Your posts makes absolutely no sense in the context of this thread!
>
Just a way to multiply two 2-ary vectors as if they were complex numbers. Now, here is a little C99 program I just typed in the newsreader. It should compile.
_____________________________
#include <stdio.h>
>
>
struct vec2
{
     float x;
     float y;
};
>
>
struct vec2
ct_cmul(
     struct vec2 p0,
     struct vec2 p1
){
     struct vec2 result = {
         p0.x * p1.x - p0.y * p1.y,
         p0.x * p1.y + p0.y * p1.x
     };
>
     return result;
}
>
>
int main()
{
     struct vec2 z = { 0, 1 };
     struct vec2 zmul = ct_cmul(z, z);
>
     printf("z = (%f, %f)\n", z.x, z.y);
     printf("zmul = (%f, %f)\n", zmul.x, zmul.y);
>
     return 0;
}
_____________________________
>
>
Let me run it on a C99 compiler... Ok, it works:
>
z = (0.000000, 1.000000)
zmul = (-1.000000, 0.000000)
>
I thought it might help out the OP.
 Mückenheim? :-P
 Note though:
 
This is quite off-topic to point out that multiplication of complex numbers in C/C++ can be done.
>
The discussion is not about that it can be done, even crank Hachel would admit this. It is *why* it makes sense to define multiplication *that way*.
 See?!
 You C code doesn't answer the latter "question".
Sorry for missing something here. The division of complex numbers?
#define cx_div(a, b) vec2(((a.x*b.x + a.y*b.y)/(b.x*b.x + b.y*b.y)),((a.y*b.x - a.x*b.y)/(b.x*b.x + b.y*b.y)))
:^)

Date Sujet#  Auteur
20 Jan 25 * Division of two complex numbers94Richard Hachel
20 Jan 25 +* Re: Division of two complex numbers80Moebius
20 Jan 25 i`* Re: Division of two complex numbers79Richard Hachel
20 Jan 25 i `* Re: Division of two complex numbers78Richard Hachel
20 Jan 25 i  +- Re: Division of two complex numbers1Moebius
20 Jan 25 i  `* Re: Division of two complex numbers76Python
20 Jan 25 i   `* Re: Division of two complex numbers75Richard Hachel
20 Jan 25 i    `* Re: Division of two complex numbers74Python
20 Jan 25 i     `* Re: Division of two complex numbers73Richard Hachel
20 Jan 25 i      `* Re: Division of two complex numbers72Python
20 Jan 25 i       `* Re: Division of two complex numbers71Moebius
20 Jan 25 i        +- Re: Division of two complex numbers1Python
20 Jan 25 i        +* Re: Division of two complex numbers3Chris M. Thomasson
20 Jan 25 i        i+- Re: Division of two complex numbers1Chris M. Thomasson
20 Jan 25 i        i`- Re: Division of two complex numbers1Moebius
20 Jan 25 i        `* Re: Division of two complex numbers66Tom Bola
20 Jan 25 i         +* Re: Division of two complex numbers3Tom Bola
21 Jan 25 i         i`* Re: Division of two complex numbers2FromTheRafters
21 Jan 25 i         i `- Re: Division of two complex numbers1Tom Bola
20 Jan 25 i         `* Re: Division of two complex numbers62Python
20 Jan 25 i          +* Re: Division of two complex numbers31Chris M. Thomasson
20 Jan 25 i          i`* Re: Division of two complex numbers30Python
20 Jan 25 i          i `* Re: Division of two complex numbers29Chris M. Thomasson
20 Jan 25 i          i  `* Re: Division of two complex numbers28Python
20 Jan 25 i          i   `* Re: Division of two complex numbers27Chris M. Thomasson
20 Jan 25 i          i    `* Re: Division of two complex numbers26Python
20 Jan 25 i          i     `* Re: Division of two complex numbers25Chris M. Thomasson
20 Jan 25 i          i      +* Re: Division of two complex numbers13Python
20 Jan 25 i          i      i`* Re: Division of two complex numbers12Chris M. Thomasson
20 Jan 25 i          i      i `* Re: Division of two complex numbers11Python
20 Jan 25 i          i      i  +- Re: Division of two complex numbers1Moebius
20 Jan 25 i          i      i  `* Re: Division of two complex numbers9Chris M. Thomasson
20 Jan 25 i          i      i   `* Re: Division of two complex numbers8Moebius
21 Jan 25 i          i      i    `* Re: Division of two complex numbers7Chris M. Thomasson
21 Jan 25 i          i      i     `* Re: Division of two complex numbers6Moebius
21 Jan 25 i          i      i      `* Re: Division of two complex numbers5Chris M. Thomasson
21 Jan 25 i          i      i       +- Re: Division of two complex numbers1Moebius
21 Jan 25 i          i      i       `* Re: Division of two complex numbers3Moebius
21 Jan 25 i          i      i        `* Re: Division of two complex numbers2Chris M. Thomasson
22 Jan 25 i          i      i         `- Re: Division of two complex numbers1Chris M. Thomasson
20 Jan 25 i          i      `* Re: Division of two complex numbers11Moebius
20 Jan 25 i          i       `* Re: Division of two complex numbers10Chris M. Thomasson
20 Jan 25 i          i        `* Re: Division of two complex numbers9Moebius
20 Jan 25 i          i         `* Re: Division of two complex numbers8Python
20 Jan 25 i          i          +- Re: Division of two complex numbers1Moebius
20 Jan 25 i          i          `* Re: Division of two complex numbers6Chris M. Thomasson
20 Jan 25 i          i           `* Re: Division of two complex numbers5Moebius
20 Jan 25 i          i            `* Re: Division of two complex numbers4Moebius
20 Jan 25 i          i             `* Re: Division of two complex numbers3Chris M. Thomasson
20 Jan 25 i          i              `* Re: Division of two complex numbers2Moebius
29 Jan 25 i          i               `- Re: Division of two complex numbers1Chris M. Thomasson
20 Jan 25 i          `* Re: Division of two complex numbers30Tom Bola
20 Jan 25 i           +* Re: Division of two complex numbers4Chris M. Thomasson
20 Jan 25 i           i`* Re: Division of two complex numbers3Tom Bola
20 Jan 25 i           i `* Re: Division of two complex numbers2Moebius
20 Jan 25 i           i  `- Re: Division of two complex numbers1Tom Bola
20 Jan 25 i           `* Re: Division of two complex numbers25Python
20 Jan 25 i            +* Re: Division of two complex numbers6Tom Bola
20 Jan 25 i            i+- Re: Division of two complex numbers1Python
20 Jan 25 i            i+- Re: Division of two complex numbers1Moebius
20 Jan 25 i            i`* Re: Division of two complex numbers3Tom Bola
20 Jan 25 i            i +- Re: Division of two complex numbers1Moebius
21 Jan 25 i            i `- Re: Division of two complex numbers1Richard Hachel
20 Jan 25 i            `* Re: Division of two complex numbers18Tom Bola
20 Jan 25 i             +- Re: Division of two complex numbers1Python
20 Jan 25 i             `* Re: Division of two complex numbers16Moebius
20 Jan 25 i              +- Re: Division of two complex numbers1Tom Bola
21 Jan 25 i              `* Re: Division of two complex numbers14Tom Bola
21 Jan 25 i               +- Re: Division of two complex numbers1Python
21 Jan 25 i               `* Re: Division of two complex numbers12Moebius
21 Jan 25 i                `* Re: Division of two complex numbers11Tom Bola
21 Jan 25 i                 `* Re: Division of two complex numbers10Moebius
21 Jan 25 i                  +* Re: Division of two complex numbers3Tom Bola
21 Jan 25 i                  i`* Division of complex.2Richard Hachel
21 Jan 25 i                  i `- Re: Division of complex.1Tom Bola
21 Jan 25 i                  `* Re: Division of two complex numbers6Moebius
21 Jan 25 i                   +* Re: Division of two complex numbers2Moebius
21 Jan 25 i                   i`- Re: Division of two complex numbers1Richard Hachel
21 Jan 25 i                   `* Re: Division of two complex numbers3Tom Bola
21 Jan 25 i                    `* Re: Division of two complex numbers2Moebius
22 Jan 25 i                     `- Re: Division of two complex numbers1Tom Bola
20 Jan 25 +* Re: Division of two complex numbers9Jim Burns
20 Jan 25 i+- Re: Division of two complex numbers1Jim Burns
20 Jan 25 i`* Re: Division of two complex numbers7Richard Hachel
20 Jan 25 i +* Re: Division of two complex numbers5Moebius
20 Jan 25 i i+* Re: Division of two complex numbers2Chris M. Thomasson
20 Jan 25 i ii`- Re: Division of two complex numbers1Chris M. Thomasson
21 Jan 25 i i`* Re: Division of two complex numbers2Richard Hachel
21 Jan 25 i i `- Re: Division of two complex numbers1Moebius
21 Jan 25 i `- Re: Division of two complex numbers1Jim Burns
21 Jan 25 `* Re: Division of two complex numbers4Ross Finlayson
21 Jan 25  `* Re: Division of two complex numbers3Richard Hachel
22 Jan 25   +- Re: Division of two complex numbers (is under-defined, like 0^0)1Ross Finlayson
22 Jan 25   `- Re: Division of two complex numbers (is under-defined, like 0^0)1Ross Finlayson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal