All pastes #119452 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-08-06 21:37 UTC
rendered paste body
float rotationSpeed = 5.0;
float three(float x) { return 3.0;}

class blah {
public:
  blah() {
    Expr::varmap_t vars;
    vars[tString("rot")] = &rotationSpeed;

    Expr::funcmap_t functions;
    functions[tString("three")] = &three;

    Expr posX(tString("250+50*cos(3.14*2/rot)"), vars, functions);
    Expr posY(tString("250+50*sin(three*3.14*2)"), vars, functions);
    std::cerr << posX.GetFloat() << " : " ;
    std::cerr << posY.GetFloat() << std::endl;
  }
};
blah asdf;