تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض هذه الدالة نقطة في وسط مكوّنات الشكل الهندسي ذات الأبعاد الأعلى. يتم تجاهل المكوّنات ذات الأبعاد الأقل، لذا فإنّ مركز الثقل لشكل هندسي يحتوي على مضلّعين وثلاثة خطوط ونقطة يساوي مركز الثقل لشكل هندسي يحتوي على المضلّعين فقط.
الاستخدام
المرتجعات
Rectangle.centroid(maxError, proj)
هندسة
الوسيطة
النوع
التفاصيل
هذا: geometry
هندسة
تحسب هذه الدالة مركز الشكل الهندسي.
maxError
ErrorMargin، القيمة التلقائية: null
الحدّ الأقصى لمقدار الخطأ المسموح به عند إجراء أي عملية إعادة إسقاط ضرورية.
proj
التوقّع، القيمة التلقائية: null
إذا تم تحديدها، ستكون النتيجة في هذا العرض. وإلا سيكون بتنسيق EPSG:4326.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["`centroid()` returns a point representing the center of the highest dimension components within a geometry, ignoring lower dimensions."],["The function prioritizes polygons over lines or points when calculating the center."],["It accepts optional `maxError` and `proj` parameters for controlling reprojection and output projection."],["The returned point can be accessed as a Geometry object."]]],["The `centroid` method calculates the center point of a geometry's highest-dimension components, ignoring lower-dimensional ones. It accepts `maxError` to define the tolerated reprojection error and `proj` to specify the output projection; otherwise, it defaults to EPSG:4326. For example, applying `centroid` to a rectangle returns its center point. The method's result, which is a `Geometry` object, can be printed and displayed on a map, as shown in JavaScript and Python code examples.\n"]]