Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #118240
| From | Malcolm McLean <malcolm.arthur.mclean@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: “We are doomed” |
| Date | 2024-01-22 11:22 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <uolj5h$n00a$2@dont-email.me> (permalink) |
| References | <uo6ufu$1kle9$1@dont-email.me> <uoeebu$387sh$2@dont-email.me> <20240119103450.676@kylheku.com> <uogjjc$3mmvp$1@dont-email.me> <20240120134252.222@kylheku.com> |
On 21/01/2024 04:06, Kaz Kylheku wrote: > On 2024-01-20, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote: >> On 19/01/2024 18:35, Kaz Kylheku wrote: >>> On 2024-01-19, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote: >>>> One problem that could be very easily fixed is that there is no standard >>>> representation of a point or a vector. Whilst generally it's just a POD >>>> structure with x and y members, the name varies, and sometimes the >>> >>> For code working with 2D vectors, designers should consider complex numbers. >>> >> That's a nice idea. >> >> But I've never seen code where the horizontal axis is "real" and the >> vertical "imaginary", except of course in code designed to demonstrate >> complex numbers as such. Mandelbrot is my favourite test program when >> getting a new system. > > Complex numbers are used for expressing mappings that have geometric > interpretations. > > In 2D computer graphics, they are convenient. E.g. to rotate > a vector that is a complex number z = a + ib, you just multiply by > a complex number that is on the unit circle representing that > angle cos(theta) + i sin(theta) . > > The multiplication math is exactly the same as > > [ cos -sin ] [ a ] > [ sin cos ] [ b ] > > Because when you multiply two complex nubmers (c + id)(a + ib), > the FOIL rule produces > > ca + icb + ida + iidb > > = (ca - db) + i(cb + da). > > And that's just > > [ c -d ] [ a ] = [ ca - db ] > [ d c ] [ b ] = [ da + cb ] > Yes I know. I did complex numbers at high school. But whilst you could use the Argand plane as your graphics surface and thus represent all points as complex numbers, I've never actually seen anyone do so, and the axes are always given different labels. Except of course in Mandelbrots or other programs concerned with complex numbers themselves. -- Check out Basic Algorithms and my other books: https://www.lulu.com/spotlight/bgy1mm
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
“We are doomed” Lynn McGuire <lynnmcguire5@gmail.com> - 2024-01-16 16:03 -0600
Re: “We are doomed” Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-01-19 18:17 +0000
Re: “We are doomed” Kaz Kylheku <433-929-6894@kylheku.com> - 2024-01-19 18:35 +0000
Re: “We are doomed” Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-01-20 13:59 +0000
Re: “We are doomed” "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-01-20 11:22 -0800
Re: “We are doomed” Kaz Kylheku <433-929-6894@kylheku.com> - 2024-01-21 04:06 +0000
Re: “We are doomed” Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-01-22 11:22 +0000
Re: “We are doomed” "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-01-22 12:22 -0800
Re: “We are doomed” "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-01-19 13:58 -0800
Re: “We are doomed” immibis <news@immibis.com> - 2024-01-22 01:22 +0100
Re: “We are doomed” Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-01-22 11:16 +0000
Re: “We are doomed” "Fred. Zwarts" <F.Zwarts@HetNet.nl> - 2024-01-22 12:34 +0100
Re: “We are doomed” Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-01-22 12:31 +0000
Re: “We are doomed” "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-01-22 12:24 -0800
Re: “We are doomed” MarioCCCP <NoliMihiFrangereMentulam@libero.it> - 2024-01-31 01:17 +0100
csiph-web