Hi & welcome, I am afraid, you will have to be a little more specific - otherwise, we can only provide a fairly generic response in the form of
- by converting the algorithm to Nasal syntax/code
- loading your code into FlightGear (e.g. via the console or by adding it to $FG_HOME/Nasal)
- providing test data to invoke your ported algorithm
- checking the output against the desired output
This would seem to be a good starting point:
http://wiki.flightgear.org/Creating_new_Nasal_scriptsAnd here some more pointers that are likely to be relevant:
Depending on the type of algo/code you have in mind, it may also be necessary to come up with routines that Nasal may not support out of the box, e.g. if you have Python or JavaScript code doing something that fgfs/Nasal cannot currently do easily.
That being said, depending on the circumstances, you may be better off porting some/all of your algo into so called "property rules" due to Nasal running typically at frame rate and being subject to frame rate/spacing (latencies) as well as due to Nasal Garbage Collection "jitters":
http://wiki.flightgear.org/Property_ruleEither way it would make sense to share some more information with us, so that others can chime in any provide additional feedback