220 19174 <55AFF364.3050303@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Miro Knejp <miro.knejp@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Point class
Date: Wed, 22 Jul 2015 21:47:48 +0200
Lines: 81
Approved: news@gmane.org
Message-ID: <55AFF364.3050303@gmail.com>
References: <beb0ccd3-3537-4c3a-a8a9-98aa2fe2a029@isocpp.org>
 <mooeku$du2$1@ger.gmane.org>
 <CAE+wLFBX2NByqyJ36jmCciy876+aV-jzcqDxMxJXrh9_TR4wEg@mail.gmail.com>
 <mooimp$ekc$1@ger.gmane.org>
 <CAE+wLFABbz9FRv1EA_UiAuTn7AY0txqr7iXVFWxaqDzoC0UT8Q@mail.gmail.com>
 <moojtn$8fb$1@ger.gmane.org>
 <CAE+wLFCmL-WQ_QoDchxskfe+gYYGbcrh_fj1d=mPuyCNcOV5pw@mail.gmail.com>
 <moon46$tfn$1@ger.gmane.org>
 <CAE+wLFCC5XvcaxpZg9V1=HZ35FWzwD1Ng1QrYT07dScH5ZCDSQ@mail.gmail.com>
 <mooos1$qen$1@ger.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: ger.gmane.org 1437594416 13909 80.91.229.3 (22 Jul 2015 19:46:56 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 22 Jul 2015 19:46:56 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC6ONSXJ54LBBJXGX6WQKGQENJOP7JY@isocpp.org Wed Jul 22 21:46:50 2015
Return-path: <std-proposals+bncBC6ONSXJ54LBBJXGX6WQKGQENJOP7JY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f72.google.com ([209.85.215.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC6ONSXJ54LBBJXGX6WQKGQENJOP7JY@isocpp.org>)
	id 1ZHzya-0005tQ-Of
	for gclcip-std-proposals@m.gmane.org; Wed, 22 Jul 2015 21:46:48 +0200
Original-Received: by laah7 with SMTP id h7sf34795148laa.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 22 Jul 2015 12:46:48 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=HCRuL7hxE11Eh6N/By3kMQ516OrbZ6qVTUggqPaVw10=;
        b=Nhcx9FNJl/Q21Iv6JkeUtAeLhAJUbGmwqUy2EPlQ5nfRY4XUr+7AODOki/Ityve2Zh
         ITB3lYxOphW150tmCa5zICa/bNr/B1J9ECyOwexamkEA8geCUiALL870bdflfPvE5Awz
         TDVisyqbFlmIXYM0dkdWY1FxSD0C+r+DJnMJ8K1SZEc0lt7p90sCxIJnCJV+cqbV0siA
         2oBOJlB1pSGIV3dCxvzXLlsijRgEWIVSGF7DrA6S7FHFhvI3uNHTOjHEODC1OZGJm5Gw
         6VnOW+IfM4mcbHJGrWC1H/FcRqqFDkXhaU6y1Up1ebHjcvRRpjTG3Cxyq9rUrbISWZWq
         LQEQ= 
X-Gm-Message-State: ALoCoQlVxhxqATvLH/UhoJRLk9EAeH0WG8xvBl5axqYmYLs1XpMdTzNllufUktafge+izolO11QH
X-Received: by 10.112.51.177 with SMTP id l17mr1923543lbo.1.1437594408272;
        Wed, 22 Jul 2015 12:46:48 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.81.74 with SMTP id y10ls1327840wix.16.canary; Wed, 22 Jul
 2015 12:46:46 -0700 (PDT)
X-Received: by 10.180.7.130 with SMTP id j2mr9708697wia.29.1437594406337;
        Wed, 22 Jul 2015 12:46:46 -0700 (PDT)
Original-Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com. [2a00:1450:400c:c05::22a])
        by mx.google.com with ESMTPS id w2si22113653wiz.83.2015.07.22.12.46.46
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 22 Jul 2015 12:46:46 -0700 (PDT)
Received-SPF: pass (google.com: domain of miro.knejp@gmail.com designates 2a00:1450:400c:c05::22a as permitted sender) client-ip=2a00:1450:400c:c05::22a;
Original-Received: by wibxm9 with SMTP id xm9so178258533wib.0
        for <std-proposals@isocpp.org>; Wed, 22 Jul 2015 12:46:46 -0700 (PDT)
X-Received: by 10.194.119.161 with SMTP id kv1mr7890262wjb.157.1437594406094;
        Wed, 22 Jul 2015 12:46:46 -0700 (PDT)
Original-Received: from [192.168.42.33] (ppp-93-104-170-143.dynamic.mnet-online.de. [93.104.170.143])
        by smtp.gmail.com with ESMTPSA id gb16sm4891065wic.5.2015.07.22.12.46.44
        for <std-proposals@isocpp.org>
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 22 Jul 2015 12:46:45 -0700 (PDT)
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.1.0
In-Reply-To: <mooos1$qen$1@ger.gmane.org>
X-Original-Sender: miro.knejp@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of miro.knejp@gmail.com designates 2a00:1450:400c:c05::22a as
 permitted sender) smtp.mail=miro.knejp@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:19174
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19174>



Am 22.07.2015 um 20:53 schrieb Matthew Woehlke:
> On 2015-07-22 14:40, David Haim wrote:
>> I'm sorry. but a point is not a vector. the standard must be mathematical
>> correct.
>> now, we might want to argue if to name it "vector" class or "point" class
>> (plus, I don't see how can we push another std::vector class :) standard
>> C++ does not have an other namespaces other than "std").
> std::la::vector :-) ('la' being short for 'linear algebra'). Or
> 'std::algebra', or whatnot.
>
>> I still think that mathematically talking - the 3 fundamental definitions
>> are "Point" "Line" and "Plane". we need to stick to these definitions from
>> the bottom up if we want to add new mathematical/graphical objects to
>> standard C++.
> That list MUST include a vector type. Both a line and plane can be
> defined by vectors (direction or normal, respectively). So you either
> NEED a vector type distinct from a point type, or you need one class
> that can be used in either context.
>
>> you also didn't took into consideration that not all vectors start from the
>> origin.
> Only a minuscule fraction of users actually want "vectors" that have a
> defined origin. Everyone else only cares about magnitude and direction,
> which is the pure linear algebra definition. (Again, a "vector" in LA is
> a numeric tuple; *nothing more*.)
>
> In fact, I'll challenge you to name a use case for a "vector" that is
> defined as an magnitude, direction, AND origin. And that isn't actually
> a line segment, or a case where the "origin" and "vector" aren't
> actually separate concepts (e.g. position and velocity of a particle).
>
The word "vector" is heavily overloaded and represented in all kinds of 
math disciplines.

You have the linear algebra "vector" that is an element of the real 
coordinate space R^n.

In Euclidean space a "spatial vector" is a direction and magnitue 
whereas a "position vector" represents the position of a point P in 
space relative to an origin O, then there are also "normal vectors" and 
a load of other vector types. It's all there in the school books.

Yes, these things are treated differently in Euclidian geometry, which 
is why points (i.e. position vectors) are denoted with a different class 
of symbols (commonly a capital letter for positional vectors, a 
lowercase letter for spatial vectors[*]). There are different kinds of 
operations defined for "position vectors" and "spatial vectors", which 
some may not take very seriously, but there is technically no definition 
of a inner product of two points, even though they are represented by 
position *vectors*, they are as well transformed differently. So there 
is very good reason for using distinct types for points and vectors as 
there is good reason to not use float for the magnitudes of both mass 
and acceleration: less bugs.

It can even improve efficiency. For example, if there is a type for 
"unit vector", and it can only be created/mutated in operations which 
guarantee the result has a magnitude of 1 or preserve the magnitude of 
its operand. Now you can overload functions on this type, meaning you 
can get rid of normalize() calls in many places that already receive a 
unit vector. One just has to be careful about making the interface not 
horribly verbose and terribly annoying to use.

Yes, GLSL, HLSL, Metal and others use the same type for all but that has 
technical, not mathematical, reasons. Sadly GLM has decided to be source 
compatible to GLSL's types and functions (as far as I know), I wish it 
was not.

[*] This distinction is often not used in physics because many capital 
letters are well known to represent actual physical propertes, like E, 
F, M etc, so different notations are used.

-- 

--- 
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-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
