{"id":191,"date":"2024-06-26T15:00:04","date_gmt":"2024-06-26T07:00:04","guid":{"rendered":"https:\/\/hyservice.fun\/?page_id=191"},"modified":"2024-06-26T15:00:04","modified_gmt":"2024-06-26T07:00:04","slug":"rsd%e8%ae%a1%e7%ae%97%e5%99%a8","status":"publish","type":"page","link":"https:\/\/hyservice.fun\/index.php\/rsd%e8%ae%a1%e7%ae%97%e5%99%a8\/","title":{"rendered":"RSD\u8ba1\u7b97\u5668"},"content":{"rendered":"\n<!DOCTYPE html>\n<html>\n<head>\n    <title>RSD\u8ba1\u7b97\u5668<\/title>\n<\/head>\n<body>\n    <h2>RSD\u8ba1\u7b97\u5668<\/h2>\n    <form id=\"rsdCalculator\">\n        <label for=\"values\">\u8f93\u5165\u503c\uff08\u7528\u9017\u53f7\u5206\u9694\uff09:<\/label><br>\n        <textarea id=\"values\" name=\"values\" rows=\"4\" cols=\"50\"><\/textarea><br><br>\n        <input type=\"button\" value=\"\u8ba1\u7b97\" onclick=\"calculateRSD()\">\n    <\/form>\n    <p id=\"result\"><\/p>\n\n    <script>\n        function calculateRSD() {\n            var valuesString = document.getElementById('values').value;\n            var valuesArray = valuesString.split(',').map(Number);\n            var n = valuesArray.length;\n\n            if (n < 2) {\n                document.getElementById('result').innerText = '\u8bf7\u8f93\u5165\u81f3\u5c11\u4e24\u4e2a\u6709\u6548\u6570\u503c';\n                return;\n            }\n\n            var sum = valuesArray.reduce((a, b) => a + b, 0);\n            var mean = sum \/ n;\n\n            var squaredDiffs = valuesArray.map(value => {\n                var diff = value - mean;\n                return diff * diff;\n            });\n\n            var variance = squaredDiffs.reduce((a, b) => a + b, 0) \/ (n - 1);\n            var standardDeviation = Math.sqrt(variance);\n            var rsd = (standardDeviation \/ mean) * 100;\n\n            document.getElementById('result').innerText = '\u8ba1\u7b97\u7ed3\u679c: ' + rsd.toFixed(2) + ' %';\n        }\n    <\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>RSD\u8ba1\u7b97\u5668 RSD\u8ba1\u7b97\u5668 \u8f93\u5165\u503c\uff08\u7528\u9017\u53f7\u5206\u9694\uff09:<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-191","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/pages\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":1,"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/pages\/191\/revisions"}],"predecessor-version":[{"id":192,"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/pages\/191\/revisions\/192"}],"wp:attachment":[{"href":"https:\/\/hyservice.fun\/index.php\/wp-json\/wp\/v2\/media?parent=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}