On 11/29/06, Krasimir Angelov [EMAIL PROTECTED] wrote:
It is possible of course but your definition doesn't correspond to any
operation in the usual vector algebra. By the way how do you define
(*)? Isn't it 3D vector multiplication?
(*) is per component multiplication, as it is in Cg/HLSL.
Hi Slavomir,
On 11/28/06, Slavomir Kaslev [EMAIL PROTECTED] wrote:
instance Num Float3 where
.
signum a | a == Float3 0 0 0 = 0
| otherwise = 1
signum has a natural generalization for vectors.
signum v = vector with the same direction as v but with |v| = 1
where
On Tue, 28 Nov 2006, Brian Hulley wrote:
While it may be tempting to want to use symbolic operators like + and -,
these quickly become very confusing when more distinctions need to be made
(eg between cross product, dot product, and scaling, or between transforming
a position versus
On 11/29/06, Krasimir Angelov [EMAIL PROTECTED] wrote:
Hi Slavomir,
On 11/28/06, Slavomir Kaslev [EMAIL PROTECTED] wrote:
instance Num Float3 where
.
signum a | a == Float3 0 0 0 = 0
| otherwise = 1
signum has a natural generalization for vectors.
signum v =
It is possible of course but your definition doesn't correspond to any
operation in the usual vector algebra. By the way how do you define
(*)? Isn't it 3D vector multiplication?
Krasimir
On 11/29/06, Slavomir Kaslev [EMAIL PROTECTED] wrote:
You mean signum = normalize? What do you think of my
Hello,
I have to define a couple of float2, float3, float4 Cg, HLSL style
vectors in Haskell. At first I was tempted to make them instances of
Num, Floating, RealFrac, etc. but some of the functions defined in
those classes have no sense for vectors. One such example is signum
from class Num.
Hello Slavomir,
Tuesday, November 28, 2006, 3:46:13 PM, you wrote:
Last question: Does haskell have something like C++ templates? For
example, some time in the future I may need types like int2, short3,
etc., that behave just like float2, float3, but use different types
for their components.
On 11/28/06, Bulat Ziganshin [EMAIL PROTECTED] wrote:
Hello Slavomir,
Tuesday, November 28, 2006, 3:46:13 PM, you wrote:
Last question: Does haskell have something like C++ templates? For
example, some time in the future I may need types like int2, short3,
etc., that behave just like
On 11/28/06, Slavomir Kaslev [EMAIL PROTECTED] wrote:
On 11/28/06, Bulat Ziganshin [EMAIL PROTECTED] wrote:
Hello Slavomir,
Tuesday, November 28, 2006, 3:46:13 PM, you wrote:
Last question: Does haskell have something like C++ templates? For
example, some time in the future I may need
On Nov 28, 2006, at 7:46 AM, Slavomir Kaslev wrote:
Hello,
I have to define a couple of float2, float3, float4 Cg, HLSL style
vectors in Haskell. At first I was tempted to make them instances of
Num, Floating, RealFrac, etc. but some of the functions defined in
those classes have no sense for
Slavomir Kaslev wrote:
I have to define a couple of float2, float3, float4 Cg, HLSL style
vectors in Haskell. At first I was tempted to make them instances of
Num, Floating, RealFrac, etc. but some of the functions defined in
those classes have no sense for vectors.
I'd suggest that this
On 11/28/06, Brian Hulley [EMAIL PROTECTED] wrote:
Slavomir Kaslev wrote:
I have to define a couple of float2, float3, float4 Cg, HLSL style
vectors in Haskell. At first I was tempted to make them instances of
Num, Floating, RealFrac, etc. but some of the functions defined in
those classes
12 matches
Mail list logo