Skip to main content
As per the comments, it was unclear whether the line was infinite or not.
Source Link
Morwenn
  • 1.8k
  • 2
  • 13
  • 22

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a (infinite) line, even though lines share properties across dimensions.

My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:

x = x0 + at
y = y0 + bt
z = z0 + ct
// can be extended to any dimension

But even with this equation, I can't find what should be stored and what should not be in order to compare lines. With an ideal solution, two objects of type Line:

  • would be programmatically equal (with operator==),
  • would have equal representations in the memory.

What should I store in order to achieve that?

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a line, even though lines share properties across dimensions.

My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:

x = x0 + at
y = y0 + bt
z = z0 + ct
// can be extended to any dimension

But even with this equation, I can't find what should be stored and what should not be in order to compare lines. With an ideal solution, two objects of type Line:

  • would be programmatically equal (with operator==),
  • would have equal representations in the memory.

What should I store in order to achieve that?

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a (infinite) line, even though lines share properties across dimensions.

My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:

x = x0 + at
y = y0 + bt
z = z0 + ct
// can be extended to any dimension

But even with this equation, I can't find what should be stored and what should not be in order to compare lines. With an ideal solution, two objects of type Line:

  • would be programmatically equal (with operator==),
  • would have equal representations in the memory.

What should I store in order to achieve that?

Fixed a typo. Format.
Source Link
Morwenn
  • 1.8k
  • 2
  • 13
  • 22

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a line, even though lines share properties across dimensions.

My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:

x = x0 + at
y = y0 + bt
z = z0 + ct
// can be extended to any dimension

But even with this equation, I can't find what should be stored and what should not be in order to compare lines. AnWith an ideal solution would be to have, two objectobjects of type Line programmatically equal (with operator==) but also to have equal representations in the memory.:

  • would be programmatically equal (with operator==),
  • would have equal representations in the memory.

What should I store in order to achieve that?

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a line, even though lines share properties across dimensions.

My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:

x = x0 + at
y = y0 + bt
z = z0 + ct
// can be extended to any dimension

But even with this equation, I can't find what should be stored and what should not be in order to compare lines. An ideal solution would be to have two object of type Line programmatically equal (with operator==) but also to have equal representations in the memory. What should I store in order to achieve that?

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a line, even though lines share properties across dimensions.

My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:

x = x0 + at
y = y0 + bt
z = z0 + ct
// can be extended to any dimension

But even with this equation, I can't find what should be stored and what should not be in order to compare lines. With an ideal solution, two objects of type Line:

  • would be programmatically equal (with operator==),
  • would have equal representations in the memory.

What should I store in order to achieve that?

Source Link
Morwenn
  • 1.8k
  • 2
  • 13
  • 22

How to represent a geometric line programmatically?

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a line, even though lines share properties across dimensions.

My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:

x = x0 + at
y = y0 + bt
z = z0 + ct
// can be extended to any dimension

But even with this equation, I can't find what should be stored and what should not be in order to compare lines. An ideal solution would be to have two object of type Line programmatically equal (with operator==) but also to have equal representations in the memory. What should I store in order to achieve that?