Menu

Triple to string

Help
2014-05-29
2014-05-29
  • Michael Doob

    Michael Doob - 2014-05-29

    I wonder why there is no triple to string function included:

    string trip2str(triple T) {
    return "(" + string(T.x) + "," + string(T.y) + "," + string(T.z) + ")";
    }

    I use this all the time and am a little surprised that it is not
    predefined. Did I miss something in the documentation? (if so,
    my bad :-( ).

     
  • John Bowman

    John Bowman - 2014-05-29

    Use a cast here: in interactive mode

    ~~~~~~~~~~~~~~~~~
    import three;
    (string) X;
    ~~~~~~~~~~~~~

    returns (1,0,0)

     

Log in to post a comment.