Trig using variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Trig using variables

    Can I take assigned IJK values and have the tangent calculated from it. I have looked through the HELP files and it is of NO HELP.

    Here is my code which missing something like how and where do I place the "TAN" statement.

    PLN_RFACE =FEAT/PLANE,RECT,TRIANGLE
    THEO/1.3101,-0.7086,-0.1107,0.9396847,0.0000591,0.3420419
    ACTL/1.3101,-0.7086,-0.1107,0.9396847,0.0000591,0.3420419
    CONSTR/PLANE,BF,RFACE_1,RFACE_2,RFACE_3,,
    OUTLIER_REMOVAL/OFF,3
    FILTER/OFF,WAVELENGTH=0
    ASSIGN/V1 = PLN_RFACE.K/PLN_RFACE.I (where do palce the TAN statement to make this work??)

    Craiger, this should be right up your "alley"

    TIA

    Duane
    Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
    Contura Calypso 5.4

    Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

  • #2
    TAN would be of an angle so we need to get the angle. I'm trying to think of the pitfalls of different quadrants and positive verses negative vectors in calculating that. Maybe I'm reading too deep into this.

    I'm giving it some thought but what exactly is the intent?

    Craig
    <internet bumper sticker goes here>

    Comment


    • #3
      I wanted to use the resultant angle to create a generic feature relative to that specific angle as I know it will vary from part to part.

      I know I can tolerance the angle between 2 features and assign variables from the dimensions and then construct my generic feature but I thought this might make the program look cleaner and have less garbage in it.

      tanA = side / side (which in essence is the I and K values)
      .342 / .939 = 20°
      Last edited by dwade; 12-14-2006, 11:14 AM.
      Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
      Contura Calypso 5.4

      Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

      Comment


      • #4
        OK your .K is a cosine that represents one angle relative to the origin as is .I is it the angle between these two angles you need? I am slow to catch on sometimes and I guess I'm not following this.
        <internet bumper sticker goes here>

        Comment


        • #5
          Ok, so you are trying to calculate the angle of the plane's vector relative to an axis? Why not just dimension this angle and use that as a variable?

          Comment


          • #6
            Because I have tunnel vision and don't want to do it any other way

            I was just playing with this and wanted to know if it can be done. I'd rather have a sinlge line of code in my program than have tolerance lines that I don't need showing in my program.

            When I was programming with GeoMeasure I used high level langauge to create features, calculations and the like to make the program "look cleaner".
            Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
            Contura Calypso 5.4

            Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

            Comment


            • #7
              Be careful trying to calculate angles from IJKs. they are compounded when a K vector is introduced....
              Links to my utilities for PCDMIS

              Comment


              • #8
                I believe you may be looking for:
                ASSIGN/V1 = ATAN(PLN_RFACE.K/PLN_RFACE.I)
                which should work, but I can't seem to get it to produce the correct result in 3.7 MR2.

                Comment


                • #9
                  Aren't the angles returned in radians?
                  Links to my utilities for PCDMIS

                  Comment


                  • #10
                    Yes it is in radians (forgot about that - no wonder it did not look right).
                    ASSIGN/V1 = RAD2DEG(ATAN(PLN_RFACE.K/PLN_RFACE.I)) should work then.
                    Of course it may need to be done in steps.

                    Comment


                    • #11
                      YES!! That works GREAT!

                      Thank you all for your help on this.
                      Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
                      Contura Calypso 5.4

                      Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

                      Comment


                      • #12
                        Will you post the corrected version
                        would like to keep in my notes

                        Thank you
                        DR Watson shut me down again !!!! :mad: Smoke break:eek:

                        Comment


                        • #13
                          Here's the code that works for the angle calcation from assigned IJK values.

                          I will also post this in the CODE forum.

                          Thanks again to RussL, cmmguy and craiger.


                          RFACE_1 =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                          THEO/1.2809,-0.4456,-0.0304,0.9397,0,0.342
                          ACTL/1.2809,-0.4456,-0.0304,0.9397,0,0.342
                          TARG/1.2809,-0.4456,-0.0304,0.9397,0,0.342
                          THEO_THICKNESS = 0,RECT,SNAP = YES,$
                          AUTO MOVE = NO,DISTANCE = 1
                          RFACE_2 =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                          THEO/1.2838,-0.8337,-0.0383,0.9397,0,0.342
                          ACTL/1.2838,-0.8337,-0.0383,0.9397,0,0.342
                          TARG/1.2838,-0.8337,-0.0383,0.9397,0,0.342
                          THEO_THICKNESS = 0,RECT,SNAP = YES,$
                          AUTO MOVE = NO,DISTANCE = 1
                          RFACE_3 =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                          THEO/1.3657,-0.8465,-0.2633,0.9397,0,0.342
                          ACTL/1.3657,-0.8465,-0.2633,0.9397,0,0.342
                          TARG/1.3657,-0.8465,-0.2633,0.9397,0,0.342
                          THEO_THICKNESS = 0,RECT,SNAP = YES,$
                          AUTO MOVE = NO,DISTANCE = 1
                          PLN_RFACE =FEAT/PLANE,RECT,TRIANGLE
                          THEO/1.3101,-0.7086,-0.1107,0.9396847,0.0000591,0.3420419
                          ACTL/1.3101,-0.7086,-0.1107,0.9396847,0.0000591,0.3420419
                          CONSTR/PLANE,BF,RFACE_1,RFACE_2,RFACE_3,,
                          OUTLIER_REMOVAL/OFF,3
                          FILTER/OFF,WAVELENGTH=0
                          ASSIGN/V2 = RAD2DEG(ATAN(PLN_RFACE.K/PLN_RFACE.I))
                          Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
                          Contura Calypso 5.4

                          Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

                          Comment


                          • #14
                            Isn't that only good for a two dimensional angle? In other words, one vector component I, J or K must be zero.

                            Comment


                            • #15
                              Yes, only a 2D angle. That is what I was looking for. I am not sure, but I think that you should not use this (adding the 3rd vector) to try and create a 3D angle. I think that if the correlating angle is needed you should assign another variable.
                              Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
                              Contura Calypso 5.4

                              Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎