Announcement

Collapse
No announcement yet.

Getting Math.atan(1) to work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting Math.atan(1) to work

    Why is this EFS not returning the right value for Math.atan(1). The Arc Tangent for 1 is 45 but I'm getting 0.785398xxxxxxxxx

    function main() {

    setPriceStudy(true);

    var lAngle;

    lAngle = Math.atan(1);

    drawTextAbsolute(-5,14, lAngle,Color.red,null,Text.BOLD | Text.ONTOP | Text.RELATIVETORIGHT | Text.RELATIVETOTOP, null,11,1 );

    }

    I really need Math.atan() for one of my EFS

    Thank you Very much

    Ketoma
    Attached Files
    Last edited by ketoma21; 04-26-2005, 03:02 PM.

  • #2
    Ketoma
    Replace lAngle = Math.atan(1); with lAngle = Math.atan(1)/( Math.PI/180 ); and it will return 45
    Also see this article in the EFS Function Reference of the EFS KnowledgeBase for an example of how to derive the slope from an angle
    Alex

    Comment


    • #3
      Thank you Very much Alexis as usual

      That fixed the problem

      and that was a very fast reply, less then a minute

      Thank you again

      Comment

      Working...
      X