[Cg1] Re: [CG1] min max definition

Pascal Grittmann s9pagrit at stud.uni-saarland.de
Sat Oct 29 18:19:38 CEST 2016


Hi,

That is exactly how you are supposed to implement it.

Best,
Pascal Grittmann


Zitat von Noshaba Cheema <s8nochee at stud.uni-saarland.de>:

> The way I understood the "component-wise" thing is like this:
>
> Vector min(const Vector& a, const Vector& b) {
>     return Vector(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z));
> }
>
> But I'm not sure if they meant it that way or if they meant it like you did.
>
>
> Quoting 강효승 <fordicus at naver.com>:
>
>> [1] min and max on a vector should apply the minimum/maximum  
>> operation component-wise.
>> [2] Vector min(const Vector& a, const Vector& b)
>> {
>> 	if (a.lensqr() <= b.lensqr()) return a;
>> 	else return b;
>> }
>>
>>
>> Q >> [1] is on the assignment-sheet, which explains min and  
>> max on "A" vector.
>> But referring to the given framework's header file "vector.h" or  
>> similarly "point.h",
>> min(), max() functions have their 2 vectors or 2 points as their arguments.
>>
>> So they are conflicting to each other as [1 vector/point] VS [2  
>> vectors/points].
>> Which is correct? Is the implementation in [2] enough? ( Just  
>> finding larger/smaller one ).
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ===============================================================
>> http://maschine.systems/cv
>> HyoSeung Robin Kang
>> B.Eng. [ Electronics ][ Advanced Materials ]
>>
>> Visual Computing,
>> Dept. of Computer Science,
>> Universität Saarland,
>> Saarbrücken, Germany.
>> http://www.master-visual-computing.de/
>>
>> Mobile  :  015-7763-43806 ( +49 15776343806 )
>> Email  : fordicus at naver.com
>> ===============================================================
>
>
>
> _______________________________________________
> Cg1 mailing list
> Cg1 at cg.uni-saarland.de
> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1





More information about the Cg1 mailing list