{"action":"created","issue":{"url":"https://api.github.com/repos/JSBSim-Team/jsbsim/issues/94","repository_url":"https://api.github.com/repos/JSBSim-Team/jsbsim","labels_url":"https://api.github.com/repos/JSBSim-Team/jsbsim/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/JSBSim-Team/jsbsim/issues/94/comments","events_url":"https://api.github.com/repos/JSBSim-Team/jsbsim/issues/94/events","html_url":"https://github.com/JSBSim-Team/jsbsim/issues/94","id":341312308,"node_id":"MDU6SXNzdWUzNDEzMTIzMDg=","number":94,"title":"<fcs_function> and <function>: suggestions for new functions","user":{"login":"mike402","id":11515032,"node_id":"MDQ6VXNlcjExNTE1MDMy","avatar_url":"https://avatars2.githubusercontent.com/u/11515032?v=4","gravatar_id":"","url":"https://api.github.com/users/mike402","html_url":"https://github.com/mike402","followers_url":"https://api.github.com/users/mike402/followers","following_url":"https://api.github.com/users/mike402/following{/other_user}","gists_url":"https://api.github.com/users/mike402/gists{/gist_id}","starred_url":"https://api.github.com/users/mike402/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike402/subscriptions","organizations_url":"https://api.github.com/users/mike402/orgs","repos_url":"https://api.github.com/users/mike402/repos","events_url":"https://api.github.com/users/mike402/events{/privacy}","received_events_url":"https://api.github.com/users/mike402/received_events","type":"User","site_admin":false},"labels":[{"id":781284037,"node_id":"MDU6TGFiZWw3ODEyODQwMzc=","url":"https://api.github.com/repos/JSBSim-Team/jsbsim/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":781284038,"node_id":"MDU6TGFiZWw3ODEyODQwMzg=","url":"https://api.github.com/repos/JSBSim-Team/jsbsim/labels/help%20wanted","name":"help wanted","color":"33aa3f","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-15T11:03:49Z","updated_at":"2018-10-27T23:43:30Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI have noticed that the following functions would be very useful to have for system development, especially navigation system:\r\n\r\n- floatng point equivalent of <mod>. For now I have snippets like this to make up for it:\r\n\r\n```\r\n    <product>\r\n     <fraction>\r\n      <product>\r\n       <p>example/input</p>\r\n       <v>0.5</v><!-- reciprocal second arg of mod -->\r\n      <product>\r\n     </fraction>\r\n     <v>2.0</v><!-- second arg of mod -->\r\n    </product>\r\n```\r\n\r\n- sawtooth from -180 to +180 degrees like geo.normdeg180() from FlightGear: http://wiki.flightgear.org/Nasal_library/geo . Without it I ended up with this black magic in many places:\r\n\r\n```\r\n    <difference>\r\n     <product>\r\n      <fraction>\r\n       <product>\r\n        <sum>\r\n         <p>example/input</p>\r\n         <v>180.0</v>\r\n         <product>\r\n          <lt>\r\n           <p>example/input</p>\r\n           <v>0.0</v>\r\n          </lt>\r\n          <v>-360.0</v>\r\n         </product>\r\n        </sum>\r\n        <!-- = 1/360 -->\r\n        <v>0.00277777777777777777</v>\r\n       </product>\r\n      </fraction>\r\n      <v>360.0</v>\r\n     </product>\r\n     <v>180.0</v>\r\n     <product>\r\n      <lt>\r\n       <p>example/input</p>\r\n       <v>0.0</v>\r\n      </lt>\r\n      <v>-360.0</v>\r\n     </product>\r\n    </difference>\r\n```\r\n\r\n- sawtooth from 0 to 360 degrees like FlightGear's geo.normdeg(), which is like floating point modulo by 360, except it should be shifted by 360 for negative input:\r\n\r\n```\r\n    <sum>\r\n     <product>\r\n      <fraction>\r\n       <product>\r\n        <p>example/input</p>\r\n        <v>0.00277777777777777777</v><!-- = 1/360 -->\r\n       </product>\r\n      </fraction>\r\n      <v>360.0</v>\r\n     </product>\r\n     <product>\r\n      <lt>\r\n       <p>example/input</p>\r\n       <v>0.0</v>\r\n      </lt>\r\n      <v>360.0</v>\r\n     </product>\r\n    </sum>\r\n```\r\n\r\nKind regards,\r\nMike"},"comment":{"url":"https://api.github.com/repos/JSBSim-Team/jsbsim/issues/comments/433664334","html_url":"https://github.com/JSBSim-Team/jsbsim/issues/94#issuecomment-433664334","issue_url":"https://api.github.com/repos/JSBSim-Team/jsbsim/issues/94","id":433664334,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzY2NDMzNA==","user":{"login":"bcoconni","id":7502904,"node_id":"MDQ6VXNlcjc1MDI5MDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/7502904?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoconni","html_url":"https://github.com/bcoconni","followers_url":"https://api.github.com/users/bcoconni/followers","following_url":"https://api.github.com/users/bcoconni/following{/other_user}","gists_url":"https://api.github.com/users/bcoconni/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoconni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoconni/subscriptions","organizations_url":"https://api.github.com/users/bcoconni/orgs","repos_url":"https://api.github.com/users/bcoconni/repos","events_url":"https://api.github.com/users/bcoconni/events{/privacy}","received_events_url":"https://api.github.com/users/bcoconni/received_events","type":"User","site_admin":false},"created_at":"2018-10-27T23:43:30Z","updated_at":"2018-10-27T23:43:30Z","author_association":"COLLABORATOR","body":"From @mike402 suggested in issue #124 that has been marked as a duplicate of the current issue:\r\n> `<floor>`, `<ceiling>` and `<fmod>` would have been very convenient, because their equivalents are very bulky and typo-prone."}}
{"actor":{"display_login":"bcoconni"}}