|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I was wondering if:
vectors can be used in Boolean conditional statements
#if (Q = <1, 1, 1>)
If the number of arguments a macro takes is a value that is user accessible,
much like dimensions and dimension_size?
Can the size of a vector be determined by a command?
<1, 2> vs <1, 2, 3> vs <1, 2, 3, 4, 5>
Is there a way to determine if an identifier is a scalar or a vector?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 25.05.2017 um 14:00 schrieb Bald Eagle:
> I was wondering if:
>
> vectors can be used in Boolean conditional statements
>
> #if (Q = <1, 1, 1>)
>
> If the number of arguments a macro takes is a value that is user accessible,
> much like dimensions and dimension_size?
>
> Can the size of a vector be determined by a command?
> <1, 2> vs <1, 2, 3> vs <1, 2, 3, 4, 5>
>
> Is there a way to determine if an identifier is a scalar or a vector?
Nononono.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 2017-05-25 08:00, also sprach Bald Eagle:
> I was wondering if:
>
> vectors can be used in Boolean conditional statements
>
> #if (Q = <1, 1, 1>)
#if (VEq(Q,<1,1,1>)
--
dik
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 26/05/2017 à 10:33, dick balaska a écrit :
> Am 2017-05-25 08:00, also sprach Bald Eagle:
>> I was wondering if:
>>
>> vectors can be used in Boolean conditional statements
>>
>> #if (Q = <1, 1, 1>)
>
#include "math.inc"
> #if (VEq(Q,<1,1,1>)
>
for 5D: VEq5D
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 26/05/2017 à 10:33, dick balaska a écrit :
> #include "math.inc"
>
> > #if (VEq(Q,<1,1,1>)
> >
>
> for 5D: VEq5D
Most excellent.
Thanks to both of you gentlemen. I had not thought to look in the vector
functions for a simple Boolean comparison.
I'm thinking that a macro that does something like a progressive #ifdef(Q.x),
#ifdef (Q.y), #ifdef(Q.z) ..... would be able to count vector elements and
return the size of the vector, and if there's only 1 element, then it's a
scalar.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 26/05/2017 à 13:57, Bald Eagle a écrit :
> Le_Forgeron <jgr### [at] freefr> wrote:
>> Le 26/05/2017 à 10:33, dick balaska a écrit :
> I'm thinking that a macro that does something like a progressive #ifdef(Q.x),
> #ifdef (Q.y), #ifdef(Q.z) ..... would be able to count vector elements and
> return the size of the vector, and if there's only 1 element, then it's a
> scalar.
You forget one thing, which lose the whole idea: automatic expansion of
scalar and vector.
#declare Scalar = 1;
Yet, Scalar.x, Scalar.y and so on are valid and defined as 1.
#declare Vector = <1,2>;
Yet, Vector.z is valid and defined as 0.
The Wise-Man said No, listen to him.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
dick balaska <dic### [at] buckosoftcom> wrote:
> Am 2017-05-25 08:00, also sprach Bald Eagle:
> > I was wondering if:
> >
> > vectors can be used in Boolean conditional statements
> >
> > #if (Q = <1, 1, 1>)
>
> #if (VEq(Q,<1,1,1>)
>
That's interesting; didn't know it could be done. But other comments here imply
that <1,1,1> is actually <1,1,1,0,0>. In which case, #if(VEq...) would still
return 0 or "false"(?). Unless VEq5D is used; but the vector would still need
<1,1,1,1,1>, not <1,1,1>, for even VEq5D to return "true."
Am I understanding this correctly?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 26.05.2017 um 19:31 schrieb Kenneth:
> dick balaska <dic### [at] buckosoftcom> wrote:
>> Am 2017-05-25 08:00, also sprach Bald Eagle:
>>> I was wondering if:
>>>
>>> vectors can be used in Boolean conditional statements
>>>
>>> #if (Q = <1, 1, 1>)
>>
>> #if (VEq(Q,<1,1,1>)
>>
>
> That's interesting; didn't know it could be done. But other comments here imply
> that <1,1,1> is actually <1,1,1,0,0>. In which case, #if(VEq...) would still
> return 0 or "false"(?). Unless VEq5D is used; but the vector would still need
> <1,1,1,1,1>, not <1,1,1>, for even VEq5D to return "true."
>
> Am I understanding this correctly?
No.
<1,1,1> is /not/ <1,1,1,0,0>.
But if you use <1,1,1> in any context where a 5-dimensional vector is
expected, it will automatically be /expanded/ to <1,1,1,0,0>.
VEq(A,B) compares the first three components of A and B. If the vectors
have more components, those are simply ignored.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|