Re:[OT] [C] Please critique my code

From: Marlene Stebbins (stebbins_at_email.com)
Date: 04/19/04


Date: Mon, 19 Apr 2004 19:29:40 GMT

Francis Glassborow wrote:

> Heron's formula is hardly the most appropriate when dealing with
> triangles specified with Cartesian co-ordinates. Much better is to
> remember some vector geometry when the problem becomes trivial The area
> of a triangle is half the vector product of a pair of vectors that
> defines the triangle. I will leave further work to you as anyone who
> wishes to ace a course should be able to do their own research once they
> have been given a nudge in the right direction.

Is this what you mean?

If vertex A is located at the origin (0, 0) of a Cartesian
coordinate system and the coordinates of the other two vertices
are given by B = (x1, y1) and C = (x2, y2), then the area S can
be computed as 1/2 times the absolute value of the determinant

      |x1 x2|
      | |
      |y1 y2|

or S = ½ |x1y2 - x2y1|.

This doesn't seem difficult but it is beyond the scope of the
math I have taken so far, so perhaps I haven't understood it
properly. If one of the vertices must be located at the origin of
the system, it won't do, since this condition would rarely be
satisfied. Furthermore, I can't see how this method is more
appropriate to the problem than Heron's formula. Unless you can
show me why it is, I think, with all due respect, that I will
stick with my original approach.

Best regards,
Marlene



Relevant Pages

  • Re: Integer tetrahedron
    ... You could make a coordinate system from the whole to the parts, ... and put a smaller triangle of balls on top of the big triangle of balls ... The four planes that defined the ...
    (sci.math)
  • Inertia tensor of triangle in arbitrary coordinate system
    ... Consider a rigid body constructed of a "thin" surface of some defined thickness and approximated by a lot of triangles - how do I find the inertia tensor for this body? ... the general idea that I've had is to find the inertia tensor of each triangle with respect to a coordinate system in the center of mass of the body. ... So if you can think of another way of finding the principal axes of some body constructed of a surface, then feel free to propose this method! ...
    (sci.physics)
  • Re: [QUIZ] Triangle Area (#160)
    ... transformation to get your 'base' (turn the triangle, ... coordinate system; however you prefer to see it) and use a simple ... #rotate that leg so it lies along X axis ...
    (comp.lang.ruby)

Loading