Forum Replies Created

  • Ivan Semchuk

    June 10, 2014 at 7:16 pm in reply to: position expression

    Oh, thank you!

  • Ivan Semchuk

    June 10, 2014 at 7:00 pm in reply to: position expression

    Thank you anway! Still working on it.
    I’m trying to match a scale of a map with its position.
    So i have 17 layers. Scale works perfect. Y coorinates aswell. Just X coorinate fdoes not work.
    So I have this code that can be just pasted into TEXT source to see that something is wrong.
    The code doe not refering anything so the project file does not need to bee uploaded.

    S=65536;
    x1=640;
    x2=-3428578.8
    t1=1;
    t2=5;

    if (time <= t1){
    sx = x1;
    }else if (time > t1 && time < t2){
    t = time - t1;
    T = t2 - t1;
    kx = Math.log(x2/x1)/T;
    sx = x1*Math.exp(kx*t);
    }else{
    sx = x2;
    }
    sx

  • Ivan Semchuk

    June 10, 2014 at 6:53 pm in reply to: position expression

    Tried it, however “sx” shows -3428526.47427368.
    And only in 1st second it show 640. Strange…
    Did you try with a simple variables I sent earlier?

  • Ivan Semchuk

    June 10, 2014 at 6:46 pm in reply to: position expression

    Here is the code with clear variables: still no luck!

    S=65536;
    x1=640;
    x2=-3428578.8
    t1=1;
    t2=5;

    if (time <= t1){
    sx = x1;
    }else if (time > t1 && time < t2){
    t = time - t1;
    T = t2 - t1;
    kx = Math.log(x2/x1)/T;
    sx = x1*Math.exp(kx*t);
    }else{
    sx = x2;
    }
    sx

  • Ivan Semchuk

    June 10, 2014 at 6:41 pm in reply to: position expression

    Thank you. But it doesn’t work(
    I understood that “sy” works, but not “sx”!
    So I separated coorinates to see less code)
    Still no guess what is vrong with divide by zero!

    layer = "17";
    S=100/comp("MapLayers").layer(layer).scale[0];
    x1=640;
    x2=x1+S*(comp("MapLayers").layer("1").position[0]-comp("MapLayers").layer(layer).position[0]);
    t1=1;
    t2=5;

    if (time <= t1){
    sx = x1;
    }else if (time > t1 && time < t2){
    t = time - t1;
    T = t2 - t1;
    kx = Math.log(x2/x1)/T;
    sx = x1*Math.exp(kx*t);
    }else{
    sx = x2;
    }
    sx

  • Ivan Semchuk

    June 10, 2014 at 6:30 pm in reply to: position expression

    Thank you for reply.
    Just fore note: added this expression to text layer.
    sx starting from 1st second to 5th gives “NaN” result.
    sy is OK always!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy