POV-Ray : Newsgroups : povray.general : Calc matrix coefs : Re: Calc matrix coefs Server Time
28 Apr 2024 11:52:08 EDT (-0400)
  Re: Calc matrix coefs  
From: Melody
Date: 25 Dec 2019 05:30:00
Message: <web.5e033972ce9dbf349da690110@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> kurtz le pirate <kur### [at] gmailcom> wrote:
> > I have tow *identicals* triangles T0 and T1
> > T0 is "at the origin" : <0,0,0>, <a,0,0>, <b,c,0>
> >
> > T1 is somewhere in space. The coordinates of the three points of the
> > triangle T1 are known.
> >
> > How to calculate rotations/translation to "move" T0 to T1 ?
> > Thank you for your help...
>
> the docunentation tells me that 'transforms.inc' has two complementary macros,
> 'vtransform()' and 'vinv_transform()'.  apparently , you can use the second to
> reverse the action of the first, so given you can transform T1 to origin, maybe
> that will help?
>
>
> regards, jr.

do you want the triangle center? there are 5.heh. incenter() is most "central"

to translate is to move it - subvectors.
translate T0 - T1

to rotate, consider your axis, long story .. heh.
gotta know your centers and sine cosine laws, there are about a dozen trig funcs
you need, or just stay home. see triangulation.inc

here a couple centers..

#macro incenter(A,B,C)
      #local a = C*vlength(A-B);
      #local b = A*vlength(B-C);
      #local c = B*vlength(C-A);
      #local d = vlength(A-B)+
                 vlength(B-C)+
                 vlength(C-A);
  #local result = (a+b+c)/d;
  result
#end
#macro centroid(A,B,C)
  #local result = (A+B+C)/3;
  result
#end

if you dont have this stuff, you're like crippled in 3D

Functions:
  inneradius(a,b,c)      3 lens
  outeradius(a,b,c)

  sss_area(a,b,c)
  sas_area(s,a,s2)
  bh_area(b,h)           Base Height

  sss_height(a,b,c)      height to side2
  sas_cos(s,a,s2)        Side Angle Side - solve length of missing side

  aas_sin(a,b,s)         AAS solve opposing side of angle2 (b)
  asa_sin(a,s,b)         ASA solve opposing side of angle2 (b)
  sss_cos(a,b,c)         SSS solve angle opposite side2    (b)
  ssa_acute(s,s2,a)      SSA solve angle opposite side2


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.