point = QgsGeometry.fromPointXY(QgsPointXY(5, 1))
line = QgsGeometry.fromPolylineXY([QgsPointXY(0, 0), QgsPointXY(2, 2), QgsPointXY(4, 1), QgsPointXY(6, 2)])
polygon = QgsGeometry.fromPolygonXY([[QgsPointXY(0, 0), QgsPointXY(0, 3), QgsPointXY(3, 3), QgsPointXY(3, 0)]])In the above example, a polygon geometry is created by providing a list of QgsPointXY points that define the vertices of the polygon. Overall, the QgsGeometry class is a useful tool in creating and manipulating geometric features within QGIS.