From: Jakob Riedle Sent: Friday, June 9, 2017 7:15 AM To: ISO C++ Standard - Future Proposals Reply To: std-pr...@isocpp.org Subject: [std-proposals] Why do we include a Matrix and Vector class into the proposed 2D Graphics Library? |
@Jakob: I had the same feeling when reading this proposal: These types should not be part of a graphics library, but instances of a general vocabulary matrix type. There are a couple of requirements to bring back from the 2D graphics proposal:- A vector/matrix type must be possible to instantiate with fixed size.- A 2 element vector should have members named x and y.
From: Bengt Gustafsson Sent: Saturday, June 10, 2017 2:42 PM |
To: ISO C++ Standard - Future Proposals Reply To: std-pr...@isocpp.org |
Subject: Re: [std-proposals] Why do we include a Matrix and Vector class into the proposed 2D Graphics Library? |
Here I think you are totally wrong. A lack of common vocabulary types is in my view a major deterrant from using C++. By providing vocabulary types like a (mathematical) vector and matrix we offer the possibilityfor third party library vendors to create libraries that can be used together seamlessly. If C++ had come with a more complete set of vocabulary types long ago we wouldn't have had CString, QString and wxString
nor would we have QPoint, wxPoint, eigen::vector2i, osg::vec2d all with the same contents but incompatible. This would have been very helpful to us who use lots of third part libraries to perform complex tasks.So on this point I say: Better late than never.
On Saturday, June 10, 2017 at 2:42:21 PM UTC-4, Bengt Gustafsson wrote:Here I think you are totally wrong. A lack of common vocabulary types is in my view a major deterrant from using C++. By providing vocabulary types like a (mathematical) vector and matrix we offer the possibilityfor third party library vendors to create libraries that can be used together seamlessly. If C++ had come with a more complete set of vocabulary types long ago we wouldn't have had CString, QString and wxString
C++98 had std::string. That stopped precisely nobody from making those other string types. C++ users have proven that having a "vocabulary type" will stop nobody from making their own. No matter how good that type is, "not invented here" syndrome is strong among us.
That's not to say that we shouldn't have good types. It's just that we shouldn't expect that having good types will prevent people from writing their own.
nor would we have QPoint, wxPoint, eigen::vector2i, osg::vec2d all with the same contents but incompatible. This would have been very helpful to us who use lots of third part libraries to perform complex tasks.So on this point I say: Better late than never.
Giving standard C++ a good 2D vector type will not cause all of those types to vanish, nor will it cause users of those types to adopt them. Giving C++ a good Unicode string type will not stop people from rolling their own.
Yes, that doesn't mean we shouldn't have them. But we need to have realistic expectations of the results of such things.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/d71c480f-bcd2-4051-9f92-523e3e6fc563%40isocpp.org.
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/20170610193134.5132345.14750.31022%40gmail.com.
std::valarray<int> /* becomes shorthand for */ std::valarray<int[]> // Note implicit/dynamic extent
std::valarray<int[3]> // is a fixed-size valarray
std::valarray<int[3][3]> // could be disallowed by now. Extendable in the future to be a matrix and so on...
template<typename T>
using point2d = std::valarray<T[2]>;
template<typename T>
using point3d = std::valarray<T[3]>;--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2818656.ZnHkfKFBaa%40tjmaciei-mobl1.
I would like to add another point this discussion.
I think we need 2d-vectors and 2d-matrix classes because they simplifies the mathematical operations involved with 2d graphics.
While we rename the 2d-vector as a point, I think this could lead novice users to add 2 point together and get a new point but the mathematical geometry doesn't make sense.
This should not replace 2d graphics APIs unlike the stream libraries, but rather a starting point for new C++ user to program 2d and 3d graphics.
This may be considered as off topic!
Where is operator+ for this type going to be defined?
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/89116eeb-c58b-4158-aa52-05735b21f9f5%40isocpp.org.
On terça-feira, 13 de junho de 2017 09:55:53 PDT Vishal Oza wrote:
> Yes I think it is a bad thing rename at least 2dvector to point breaks the
> math. A point in 2d space (but also in 3d space) is simple a set of
> coordinates. I think that this could lead to garabage models with no type
> safety like in C. What does it means to only ad a group of points together
> without diving the them by a total numbers of point added. That is just a
> garabage model.
A point is identified by a vector and the origin of coordinate.
Existing practice is inconsistent with the ordering.
Example: Northing and Easting, although sometimes reversed, world coordinates are often presented with Northing first. Northing being Y and Easting being X, however this can differ in different geographic regions.
I'm not against standardizing the ordering, but doing so should not be done lightly.
-- Chet.
I'm personally ok with 5, 6 and 4 (in order of decreasing preference).Jakob
I'm personally ok with 5, 6 and 4 (in order of decreasing preference).Jakob
I'm not against standardizing the ordering, but doing so should not be done lightly.
-- Chet.
It is actually cultural-specific, e.g. in Chinese, Northing almost always comes first.
`operator*` for std::valarray is not what you want for linear algebra
types...
A point is identified by a vector and the origin of coordinate.And since the origin is (almost always) known, point == vector.
From: Klaim - Joël Lamotte Sent: Friday, June 16, 2017 11:06 AM Reply To: std-pr...@isocpp.org Subject: Re: [std-proposals] Re: Why do we include a Matrix and Vector class into the proposed 2D Graphics Library? |
It is not incorrect. Mathematicians have been doing it for hundreds of years.It can, however, lead to incorrect code, if used incorrectly.But there are also advantages to it.It's a trade off.Sent from my BlackBerry portable Babbage Device
From: Klaim - Joël LamotteSent: Friday, June 16, 2017 11:06 AMReply To: std-pr...@isocpp.orgSubject: Re: [std-proposals] Re: Why do we include a Matrix and Vector class into the proposed 2D Graphics Library?
--On 13 June 2017 at 19:31, Tony V E <tvan...@gmail.com> wrote:A point is identified by a vector and the origin of coordinate.And since the origin is (almost always) known, point == vector.
If you have a Point and want a translated Point from this original point,you need an origin and a vector to do the translation. Even whenthe first point is implicitely considered the origin, you still need a vectorto describe the translation. The vector does not represent a point.Assuming that point == vector is like assuming that a physical position is also a physical momentum.It's just incorrect (like time_point is not a duration).Joël Lamotte
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOU91OOMYLL%2BhriPpGF_Py6AQ4gX2i6%3DjkL5kRR4URM7Aj1Xgg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/20170617104237.5132345.12582.31348%40gmail.com.