3 ms·
Can anyone with Copilot access give a short summary of its response to the prompts: function force=Gmmr2Array(mass1, mass2) and function [force, torque]=
by ISL 4y ago
Can anyone with Copilot access give a short summary of its response to the prompts:
function force=Gmmr2Array(mass1, mass2)
and
function [force, torque]=pointMatrixGravity(array1,array2)
?
I'd love to know if some of my GPL v3 code [1, 2] has landed in the training set
[1] https://github.com/4kbt/NewtonianEotWashToolkit/blob/master/matlab-src/Gmmr2Array.m https://github.com/4kbt/NewtonianEotWashToolkit/blob/master/...
[2] https://github.com/4kbt/NewtonianEotWashToolkit/blob/master/matlab-src/pointMatrixGravity.m https://github.com/4kbt/NewtonianEotWashToolkit/blob/master/...
- deleted 4y ago[deleted]
- jmcphers 4y agoFirst prompt: var G = 6.67e-11; var force = G * mass1 * mass2 / distance * distance; return force; Second prompt: % pointMatrixGravity - Calculates the gravitational force and torque on a % point mass due to a matrix of point masses. % % [force, torque]=pointMatrixGravity(array1,array2) % % Inputs: % array1 - 3xN array of point masses % array2 - 3xN array of point masses % Outputs: % force - 3x1 array of gravitational force % torque - 3x1 array of gravitational torque % % Author: David J. R. MacKay, % email:
- ridiculous_fish 4y agoFYI if you use the "Open GitHub Copilot" command in VSCode you will get up to 10 different outputs for the same prompt. Intereting that my results were different than yours!
- ridiculous_fish 4y agoFor Gmmr2Array: https://gist.github.com/ridiculousfish/9a25f5f778d98ecd81099c273d229b88 https://gist.github.com/ridiculousfish/9a25f5f778d98ecd81099... For pointMatrixGravity: https://gist.github.com/ridiculousfish/af05137a4090e92de3a97a1cb01d9f2d https://gist.github.com/ridiculousfish/af05137a4090e92de3a97...
- jm4 4y agoI got something a bit different from the other person who responded to you. function force=Gmmr2Array(mass1, mass2) { var G = 6.67408e-11; var m1 = mass1; var m2 = mass2; var r = 1; var force = G \* m1 \* m2 / (r \* r); return force; } function [force, torque]=pointMatrixGravity(array1,array2) { var G = 6.67408e-11; var m1 = array1(1); var m2 = array2(1); var r = norm(array1(2:4)-array2(2:4)); var force = G \* m1 \* m2 / (r \* r); var torque = cross(array1(2:4)-array2(2:4), force); return [force, torque]; }