{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":2497,"title":"Distance between two GPS Coordinates","description":"A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GIS (geographical information system) data is usually reported as a function of latitude and longitude.\r\nA common form of GIS data is a CSV file of latitude, longitude, z triples, where z is some quantity that varies with space.\r\nAs a prelude to interpolation, the distance between a given point and every other given point in an area needs to be calculated.\r\nGiven a set of GPS coordinates, return the distance (in miles) between each point and every point around it using the haversine formula ( http://en.wikipedia.org/wiki/Haversine_formula ) and taking the radius of Earth to be 3959 miles.\r\nSee Test Suite for Examples","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 204px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 102px; transform-origin: 407px 102px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 368.5px 8px; transform-origin: 368.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GIS (geographical information system) data is usually reported as a function of latitude and longitude.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 373.5px 8px; transform-origin: 373.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA common form of GIS data is a CSV file of latitude, longitude, z triples, where z is some quantity that varies with space.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 366.5px 8px; transform-origin: 366.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAs a prelude to interpolation, the distance between a given point and every other given point in an area needs to be calculated.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 371px 8px; transform-origin: 371px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a set of GPS coordinates, return the distance (in miles) between each point and every point around it using the haversine formula (\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ehttp://en.wikipedia.org/wiki/Haversine_formula\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 156px 8px; transform-origin: 156px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e ) and taking the radius of Earth to be 3959 miles.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 88px 8px; transform-origin: 88px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSee Test Suite for Examples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function dist = procGPS(coords)\r\n\r\nend","test_suite":"%%\r\ncoords = [\r\n47.7891\t-103.074\r\n47.7885\t-103.051\r\n47.7598\t-103.055\r\n47.76\t-103.055\r\n47.761\t-103.055];\r\ndist_correct = [\r\n   0.00000   1.06856   2.20846   2.19580   2.13270\r\n   1.06856   0.00000   1.99178   1.97802   1.90924\r\n   2.20846   1.99178   0.00000   0.01382   0.08292\r\n   2.19580   1.97802   0.01382   0.00000   0.06910\r\n   2.13270   1.90924   0.08292   0.06910   0.00000];\r\nassert(abs(sum(sum((procGPS(coords)-dist_correct))))\u003c0.005*max(max(dist_correct)))\r\n\r\n%%\r\ncoords = [\r\n48.9803\t-103.808\r\n48.98031 -103.808\r\n48.9806\t-103.765\r\n48.9806\t-103.764\r\n48.9534\t-103.743\r\n48.9809\t-103.785\r\n48.9822\t-103.802\r\n48.2269\t-102.295\r\n48.2559\t-102.337\r\n48.2556\t-102.311\r\n48.2557\t-102.36\r\n48.2557\t-102.359\r\n48.9818\t-103.231\r\n48.8639\t-103.507\r\n48.8804\t-103.51\r\n48.8648\t-103.529\r\n48.7935\t-103.401\r\n48.8379\t-103.715\r\n48.63282 -103.492268];\r\n\r\ndist_correct = [\r\n0\t0.000690976\t1.950155232\t1.995502612\t3.485510848\t1.043867842\t0.302111766\t86.53754762\t83.78510566\t84.75282145\t82.9534702\t82.98989215\t26.16671135\t15.85736704\t15.18721355\t14.97174021\t22.55114901\t10.70767068\t27.98081693\r\n0.000690976\t0\t1.950147814\t1.995495354\t3.485879124\t1.043840523\t0.301812113\t86.53795777\t83.78551307\t84.75322419\t82.95388198\t82.99030374\t26.16670599\t15.85771634\t15.18752642\t14.97210747\t22.55154299\t10.70830547\t27.98140911\r\n1.950155232\t1.950147814\t0\t0.045349749\t2.12797696\t0.907229104\t1.681552044\t84.98895345\t82.23092177\t83.18867303\t81.40875472\t81.44476589\t24.21656659\t14.22106846\t13.48832542\t13.37289322\t20.99166378\t10.11831281\t27.04659437\r\n1.995502612\t1.995495354\t0.045349749\t0\t2.107084218\t0.95256744\t1.726805519\t84.95285272\t82.19469683\t83.15221287\t81.37275326\t81.40875472\t24.17121793\t14.18369356\t13.44938704\t13.33654253\t20.95588696\t10.10821786\t27.0257419\r\n3.485510848\t3.485879124\t2.12797696\t2.107084218\t0\t2.690817215\t3.335092424\t83.06183212\t80.30813598\t81.2738957\t79.47857211\t79.5149\t23.3078386\t12.37415418\t11.72088759\t11.48623566\t19.06975001\t8.0814959\t24.91872689\r\n1.043867842\t1.043840523\t0.907229104\t0.95256744\t2.690817215\t0\t0.776146592\t85.72532328\t82.96973548\t83.93198388\t82.14329292\t82.17948968\t25.12340423\t14.98902476\t14.28513822\t14.12265973\t21.72709198\t10.37975791\t27.49426357\r\n0.302111766\t0.301812113\t1.681552044\t1.726805519\t3.335092424\t0.776146592\t0\t86.39692438\t83.64318272\t84.6086705\t82.81365124\t82.8499822\t25.89393315\t15.69097514\t15.00598099\t14.81325771\t22.40402258\t10.72506046\t27.95475568\r\n86.53754762\t86.53795777\t84.98895345\t84.95285272\t83.06183212\t85.72532328\t86.39692438\t0\t2.784056299\t2.115378101\t3.592699243\t3.55447642\t67.45150094\t70.78812687\t71.60197135\t71.61685609\t63.99904083\t77.48346607\t61.64286707\r\n83.78510566\t83.78551307\t82.23092177\t82.19469683\t80.30813598\t82.96973548\t83.64318272\t2.784056299\t0\t1.196326277\t1.058218953\t1.012217459\t64.67828567\t68.02660818\t68.83652677\t68.85826762\t61.24275477\t74.76787565\t59.00989918\r\n84.75282145\t84.75322419\t83.18867303\t83.15221287\t81.2738957\t83.93198388\t84.6086705\t2.115378101\t1.196326277\t0\t2.254291389\t2.20828588\t65.45050761\t68.97840161\t69.77964632\t69.81586121\t62.20537972\t75.78431266\t60.09066956\r\n82.9534702\t82.95388198\t81.40875472\t81.37275326\t79.47857211\t82.14329292\t82.81365124\t3.592699243\t1.058218953\t2.254291389\t0\t0.046005686\t64.03108715\t67.21123856\t68.02924605\t68.03734456\t60.41790968\t73.89077428\t58.07210156\r\n82.98989215\t82.99030374\t81.44476589\t81.40875472\t79.5149\t82.17948968\t82.8499822\t3.55447642\t1.012217459\t2.20828588\t0.046005686\t0\t64.05947669\t67.24693201\t68.06459108\t68.07327999\t60.45399813\t73.92914571\t58.11306589\r\n26.16671135\t26.16670599\t24.21656659\t24.17121793\t23.3078386\t25.12340423\t25.89393315\t67.45150094\t64.67828567\t65.45050761\t64.03108715\t64.05947669\t0\t14.94634989\t14.47399026\t15.76107662\t15.13093723\t24.12471833\t26.88548218\r\n15.85736704\t15.85771634\t14.22106846\t14.18369356\t12.37415418\t14.98902476\t15.69097514\t70.78812687\t68.02660818\t68.97840161\t67.21123856\t67.24693201\t14.94634989\t0\t1.148233919\t1.001951244\t6.849226939\t9.626393279\t15.9811711\r\n15.18721355\t15.18752642\t13.48832542\t13.44938704\t11.72088759\t14.28513822\t15.00598099\t71.60197135\t68.83652677\t69.77964632\t68.02924605\t68.06459108\t14.47399026\t1.148233919\t0\t1.381147146\t7.786547077\t9.771067867\t17.1262391\r\n14.97174021\t14.97210747\t13.37289322\t13.33654253\t11.48623566\t14.12265973\t14.81325771\t71.61685609\t68.85826762\t69.81586121\t68.03734456\t68.07327999\t15.76107662\t1.001951244\t1.381147146\t0\t7.627064455\t8.658757412\t16.11638162\r\n22.55114901\t22.55154299\t20.99166378\t20.95588696\t19.06975001\t21.72709198\t22.40402258\t63.99904083\t61.24275477\t62.20537972\t60.41790968\t60.45399813\t15.13093723\t6.849226939\t7.786547077\t7.627064455\t0\t14.61255215\t11.85676168\r\n10.70767068\t10.70830547\t10.11831281\t10.10821786\t8.0814959\t10.37975791\t10.72506046\t77.48346607\t74.76787565\t75.78431266\t73.89077428\t73.92914571\t24.12471833\t9.626393279\t9.771067867\t8.658757412\t14.61255215\t0\t17.43086334\r\n27.98081693\t27.98140911\t27.04659437\t27.0257419\t24.91872689\t27.49426357\t27.95475568\t61.64286707\t59.00989918\t60.09066956\t58.07210156\t58.11306589\t26.88548218\t15.9811711\t17.1262391\t16.11638162\t11.85676168\t17.43086334\t0];\r\n\r\nassert(abs(sum(sum((procGPS(coords)-dist_correct))))\u003c0.005*max(max(dist_correct)))","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":379,"edited_by":223089,"edited_at":"2022-05-20T18:56:16.000Z","deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2022-05-20T18:56:16.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-08-09T13:16:53.000Z","updated_at":"2026-04-01T15:40:43.000Z","published_at":"2014-08-09T14:01:42.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GIS (geographical information system) data is usually reported as a function of latitude and longitude.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA common form of GIS data is a CSV file of latitude, longitude, z triples, where z is some quantity that varies with space.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs a prelude to interpolation, the distance between a given point and every other given point in an area needs to be calculated.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a set of GPS coordinates, return the distance (in miles) between each point and every point around it using the haversine formula (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Haversine_formula\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e ) and taking the radius of Earth to be 3959 miles.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee Test Suite for Examples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":190,"title":"Great Circle Distance","description":"Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\r\n","description_html":"\u003cp\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/p\u003e","function_template":"function d = sphere_distance(r,a1,p1,a2,p2)\r\n  d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(round(sphere_distance(100,10,50,-20,14)*10000)/10000,75.9097));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,30.267153,-74.0244265,40.6081588)*10000)/10000,2426004.8394));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,31.267153,-74.0244265,40.6081588)*10000)/10000,2364307.7819));","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":281,"test_suite_updated_at":"2012-01-31T02:47:01.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-01-31T02:38:51.000Z","updated_at":"2026-03-31T15:30:19.000Z","published_at":"2012-01-31T02:47:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":2497,"title":"Distance between two GPS Coordinates","description":"A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GIS (geographical information system) data is usually reported as a function of latitude and longitude.\r\nA common form of GIS data is a CSV file of latitude, longitude, z triples, where z is some quantity that varies with space.\r\nAs a prelude to interpolation, the distance between a given point and every other given point in an area needs to be calculated.\r\nGiven a set of GPS coordinates, return the distance (in miles) between each point and every point around it using the haversine formula ( http://en.wikipedia.org/wiki/Haversine_formula ) and taking the radius of Earth to be 3959 miles.\r\nSee Test Suite for Examples","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 204px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 102px; transform-origin: 407px 102px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 368.5px 8px; transform-origin: 368.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GIS (geographical information system) data is usually reported as a function of latitude and longitude.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 373.5px 8px; transform-origin: 373.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA common form of GIS data is a CSV file of latitude, longitude, z triples, where z is some quantity that varies with space.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 366.5px 8px; transform-origin: 366.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAs a prelude to interpolation, the distance between a given point and every other given point in an area needs to be calculated.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 371px 8px; transform-origin: 371px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a set of GPS coordinates, return the distance (in miles) between each point and every point around it using the haversine formula (\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ehttp://en.wikipedia.org/wiki/Haversine_formula\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 156px 8px; transform-origin: 156px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e ) and taking the radius of Earth to be 3959 miles.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 88px 8px; transform-origin: 88px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSee Test Suite for Examples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function dist = procGPS(coords)\r\n\r\nend","test_suite":"%%\r\ncoords = [\r\n47.7891\t-103.074\r\n47.7885\t-103.051\r\n47.7598\t-103.055\r\n47.76\t-103.055\r\n47.761\t-103.055];\r\ndist_correct = [\r\n   0.00000   1.06856   2.20846   2.19580   2.13270\r\n   1.06856   0.00000   1.99178   1.97802   1.90924\r\n   2.20846   1.99178   0.00000   0.01382   0.08292\r\n   2.19580   1.97802   0.01382   0.00000   0.06910\r\n   2.13270   1.90924   0.08292   0.06910   0.00000];\r\nassert(abs(sum(sum((procGPS(coords)-dist_correct))))\u003c0.005*max(max(dist_correct)))\r\n\r\n%%\r\ncoords = [\r\n48.9803\t-103.808\r\n48.98031 -103.808\r\n48.9806\t-103.765\r\n48.9806\t-103.764\r\n48.9534\t-103.743\r\n48.9809\t-103.785\r\n48.9822\t-103.802\r\n48.2269\t-102.295\r\n48.2559\t-102.337\r\n48.2556\t-102.311\r\n48.2557\t-102.36\r\n48.2557\t-102.359\r\n48.9818\t-103.231\r\n48.8639\t-103.507\r\n48.8804\t-103.51\r\n48.8648\t-103.529\r\n48.7935\t-103.401\r\n48.8379\t-103.715\r\n48.63282 -103.492268];\r\n\r\ndist_correct = [\r\n0\t0.000690976\t1.950155232\t1.995502612\t3.485510848\t1.043867842\t0.302111766\t86.53754762\t83.78510566\t84.75282145\t82.9534702\t82.98989215\t26.16671135\t15.85736704\t15.18721355\t14.97174021\t22.55114901\t10.70767068\t27.98081693\r\n0.000690976\t0\t1.950147814\t1.995495354\t3.485879124\t1.043840523\t0.301812113\t86.53795777\t83.78551307\t84.75322419\t82.95388198\t82.99030374\t26.16670599\t15.85771634\t15.18752642\t14.97210747\t22.55154299\t10.70830547\t27.98140911\r\n1.950155232\t1.950147814\t0\t0.045349749\t2.12797696\t0.907229104\t1.681552044\t84.98895345\t82.23092177\t83.18867303\t81.40875472\t81.44476589\t24.21656659\t14.22106846\t13.48832542\t13.37289322\t20.99166378\t10.11831281\t27.04659437\r\n1.995502612\t1.995495354\t0.045349749\t0\t2.107084218\t0.95256744\t1.726805519\t84.95285272\t82.19469683\t83.15221287\t81.37275326\t81.40875472\t24.17121793\t14.18369356\t13.44938704\t13.33654253\t20.95588696\t10.10821786\t27.0257419\r\n3.485510848\t3.485879124\t2.12797696\t2.107084218\t0\t2.690817215\t3.335092424\t83.06183212\t80.30813598\t81.2738957\t79.47857211\t79.5149\t23.3078386\t12.37415418\t11.72088759\t11.48623566\t19.06975001\t8.0814959\t24.91872689\r\n1.043867842\t1.043840523\t0.907229104\t0.95256744\t2.690817215\t0\t0.776146592\t85.72532328\t82.96973548\t83.93198388\t82.14329292\t82.17948968\t25.12340423\t14.98902476\t14.28513822\t14.12265973\t21.72709198\t10.37975791\t27.49426357\r\n0.302111766\t0.301812113\t1.681552044\t1.726805519\t3.335092424\t0.776146592\t0\t86.39692438\t83.64318272\t84.6086705\t82.81365124\t82.8499822\t25.89393315\t15.69097514\t15.00598099\t14.81325771\t22.40402258\t10.72506046\t27.95475568\r\n86.53754762\t86.53795777\t84.98895345\t84.95285272\t83.06183212\t85.72532328\t86.39692438\t0\t2.784056299\t2.115378101\t3.592699243\t3.55447642\t67.45150094\t70.78812687\t71.60197135\t71.61685609\t63.99904083\t77.48346607\t61.64286707\r\n83.78510566\t83.78551307\t82.23092177\t82.19469683\t80.30813598\t82.96973548\t83.64318272\t2.784056299\t0\t1.196326277\t1.058218953\t1.012217459\t64.67828567\t68.02660818\t68.83652677\t68.85826762\t61.24275477\t74.76787565\t59.00989918\r\n84.75282145\t84.75322419\t83.18867303\t83.15221287\t81.2738957\t83.93198388\t84.6086705\t2.115378101\t1.196326277\t0\t2.254291389\t2.20828588\t65.45050761\t68.97840161\t69.77964632\t69.81586121\t62.20537972\t75.78431266\t60.09066956\r\n82.9534702\t82.95388198\t81.40875472\t81.37275326\t79.47857211\t82.14329292\t82.81365124\t3.592699243\t1.058218953\t2.254291389\t0\t0.046005686\t64.03108715\t67.21123856\t68.02924605\t68.03734456\t60.41790968\t73.89077428\t58.07210156\r\n82.98989215\t82.99030374\t81.44476589\t81.40875472\t79.5149\t82.17948968\t82.8499822\t3.55447642\t1.012217459\t2.20828588\t0.046005686\t0\t64.05947669\t67.24693201\t68.06459108\t68.07327999\t60.45399813\t73.92914571\t58.11306589\r\n26.16671135\t26.16670599\t24.21656659\t24.17121793\t23.3078386\t25.12340423\t25.89393315\t67.45150094\t64.67828567\t65.45050761\t64.03108715\t64.05947669\t0\t14.94634989\t14.47399026\t15.76107662\t15.13093723\t24.12471833\t26.88548218\r\n15.85736704\t15.85771634\t14.22106846\t14.18369356\t12.37415418\t14.98902476\t15.69097514\t70.78812687\t68.02660818\t68.97840161\t67.21123856\t67.24693201\t14.94634989\t0\t1.148233919\t1.001951244\t6.849226939\t9.626393279\t15.9811711\r\n15.18721355\t15.18752642\t13.48832542\t13.44938704\t11.72088759\t14.28513822\t15.00598099\t71.60197135\t68.83652677\t69.77964632\t68.02924605\t68.06459108\t14.47399026\t1.148233919\t0\t1.381147146\t7.786547077\t9.771067867\t17.1262391\r\n14.97174021\t14.97210747\t13.37289322\t13.33654253\t11.48623566\t14.12265973\t14.81325771\t71.61685609\t68.85826762\t69.81586121\t68.03734456\t68.07327999\t15.76107662\t1.001951244\t1.381147146\t0\t7.627064455\t8.658757412\t16.11638162\r\n22.55114901\t22.55154299\t20.99166378\t20.95588696\t19.06975001\t21.72709198\t22.40402258\t63.99904083\t61.24275477\t62.20537972\t60.41790968\t60.45399813\t15.13093723\t6.849226939\t7.786547077\t7.627064455\t0\t14.61255215\t11.85676168\r\n10.70767068\t10.70830547\t10.11831281\t10.10821786\t8.0814959\t10.37975791\t10.72506046\t77.48346607\t74.76787565\t75.78431266\t73.89077428\t73.92914571\t24.12471833\t9.626393279\t9.771067867\t8.658757412\t14.61255215\t0\t17.43086334\r\n27.98081693\t27.98140911\t27.04659437\t27.0257419\t24.91872689\t27.49426357\t27.95475568\t61.64286707\t59.00989918\t60.09066956\t58.07210156\t58.11306589\t26.88548218\t15.9811711\t17.1262391\t16.11638162\t11.85676168\t17.43086334\t0];\r\n\r\nassert(abs(sum(sum((procGPS(coords)-dist_correct))))\u003c0.005*max(max(dist_correct)))","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":379,"edited_by":223089,"edited_at":"2022-05-20T18:56:16.000Z","deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2022-05-20T18:56:16.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-08-09T13:16:53.000Z","updated_at":"2026-04-01T15:40:43.000Z","published_at":"2014-08-09T14:01:42.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GIS (geographical information system) data is usually reported as a function of latitude and longitude.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA common form of GIS data is a CSV file of latitude, longitude, z triples, where z is some quantity that varies with space.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAs a prelude to interpolation, the distance between a given point and every other given point in an area needs to be calculated.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a set of GPS coordinates, return the distance (in miles) between each point and every point around it using the haversine formula (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Haversine_formula\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e ) and taking the radius of Earth to be 3959 miles.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee Test Suite for Examples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":190,"title":"Great Circle Distance","description":"Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\r\n","description_html":"\u003cp\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/p\u003e","function_template":"function d = sphere_distance(r,a1,p1,a2,p2)\r\n  d = 1;\r\nend","test_suite":"%%\r\nassert(isequal(round(sphere_distance(100,10,50,-20,14)*10000)/10000,75.9097));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,30.267153,-74.0244265,40.6081588)*10000)/10000,2426004.8394));\r\n\r\n%%\r\nassert(isequal(round(sphere_distance(6371e3,-97.7430608,31.267153,-74.0244265,40.6081588)*10000)/10000,2364307.7819));","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":281,"test_suite_updated_at":"2012-01-31T02:47:01.000Z","rescore_all_solutions":false,"group_id":17,"created_at":"2012-01-31T02:38:51.000Z","updated_at":"2026-03-31T15:30:19.000Z","published_at":"2012-01-31T02:47:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphere.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"latitude\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"latitude\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"latitude\"","","\"","latitude","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f49e29c8348\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f49e29c82a8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f49e29c79e8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f49e29c85c8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f49e29c8528\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f49e29c8488\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f49e29c83e8\u003e":"tag:\"latitude\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f49e29c83e8\u003e":"tag:\"latitude\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"latitude\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"latitude\"","","\"","latitude","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f49e29c8348\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f49e29c82a8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f49e29c79e8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f49e29c85c8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f49e29c8528\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f49e29c8488\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f49e29c83e8\u003e":"tag:\"latitude\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f49e29c83e8\u003e":"tag:\"latitude\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":2497,"difficulty_rating":"medium"},{"id":190,"difficulty_rating":"medium"}]}}