Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #118235
| From | Kaz Kylheku <433-929-6894@kylheku.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: “We are doomed” |
| Date | 2024-01-21 04:06 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <20240120134252.222@kylheku.com> (permalink) |
| References | <uo6ufu$1kle9$1@dont-email.me> <uoeebu$387sh$2@dont-email.me> <20240119103450.676@kylheku.com> <uogjjc$3mmvp$1@dont-email.me> |
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 ] -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.
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