Monday, January 22, 2024

Digest for comp.lang.c++@googlegroups.com - 7 updates in 1 topic

immibis <news@immibis.com>: Jan 22 01:22AM +0100

On 1/19/24 19:17, Malcolm McLean wrote:
> be the same structures or incompatible structures.
> But a simple standardisation would mean the end of pointless editing of
> code just to conform to whatever the host program has chosen.
 
And what should be the data type of the coefficients of the vector? And
what should? Why not also have matrices? What is the maximum dimension
supported? Are homogeneous coordinates a built-in feature? No, leave the
graphics stuff to a graphics team.
Malcolm McLean <malcolm.arthur.mclean@gmail.com>: Jan 22 11:16AM

On 22/01/2024 00:22, immibis wrote:
> what should? Why not also have matrices? What is the maximum dimension
> supported? Are homogeneous coordinates a built-in feature? No, leave the
> graphics stuff to a graphics team.
It should take a template, so any type can be used for the coefficients.
Unless you have some weird and wonderful ideas, it will of course be
scalar.
I'd recommend a 2D with x and y and a 3D with x, y and z. Humanity is
not going to be elevated to a higher dimension any time soon. No
homogenous co-ordinates. No angle / magnitude notation. No need for
matrices because we already have a natural representation of the these,
since C++ supports 2 dimensional fixed size array.
Needing to store points in 2D or 3D space is a common requirement, and
code needs to communicate with other modules. One of which will be the
graphics system, which may well have requirements beyond simple points
in space, but will include such a requirement.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm
Malcolm McLean <malcolm.arthur.mclean@gmail.com>: Jan 22 11:22AM

On 21/01/2024 04:06, Kaz Kylheku wrote:
 
> 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
"Fred. Zwarts" <F.Zwarts@HetNet.nl>: Jan 22 12:34PM +0100

Op 22.jan.2024 om 12:16 schreef Malcolm McLean:
> code needs to communicate with other modules. One of which will be the
> graphics system, which may well have requirements beyond simple points
> in space, but will include such a requirement.
 
According to Einstein, humanity lives already in a four dimensional
space; time is the fourth dimension.
There are many problems in physics and other fields with even more than
4 dimensions, so it would be short-sighted to limit the library to 3
dimensions.
In addition one could ask how far the standard library must go. What
operations must be supported? Calculate the length of a vector, allowing
non-Euclidian spaces?
Malcolm McLean <malcolm.arthur.mclean@gmail.com>: Jan 22 12:31PM

On 22/01/2024 11:34, Fred. Zwarts wrote:
> In addition one could ask how far the standard library must go. What
> operations must be supported? Calculate the length of a vector, allowing
> non-Euclidian spaces?
No-one is saying that you can't devise your own structures if you want
to write programs to solve problems in general relativity. The idea is
to have a common standard for the common requirement to represent pints
and vectors in 2d and 3d spaces, so that routines writen in C++ can
communicate with each other without the need for adapter code or rewriting.
However having decided on a representation for points, there is also a
very strong case for a standard library for basic operations on those
points, such as taking the length of a vector. However probably not
non-Euclidian spaces. Again, some people will want to write software
that operates in Hilbert space or other non-Euclidean space, but it's
likely to be specialised, and so you can't expect much support from the
standard library.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 22 12:22PM -0800

On 1/22/2024 3:22 AM, Malcolm McLean wrote:
> anyone do so, and the axes are always given different labels. Except of
> course in Mandelbrots or other programs concerned with complex numbers
> themselves.
 
Usually a vector, say 2-ary (x, y), x is the horizontal axis and y is
the vertical axis. This matches a complex number x + yi:
 
+y
|
-x--0--+x
|
-y
 
x is real, y is imaginary. :^)
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 22 12:24PM -0800

On 1/22/2024 3:16 AM, Malcolm McLean wrote:
> code needs to communicate with other modules. One of which will be the
> graphics system, which may well have requirements beyond simple points
> in space, but will include such a requirement.
 
And 4-ary with (x, y, z, w)
 
Again I am quite fond of the GLM library. It's just nice to me.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: